use of org.activityinfo.i18n.tools.output.PropertiesBuilder in project activityinfo by bedatadriven.
the class Pull method updateProperties.
/**
* Updates the properties files with the latest translations
*/
private void updateProperties(ResourceClass resourceClass, TranslationSet translations) throws IOException {
// Validate messages first to avoid causing compile errors
TranslationSet validated = validateMessages(resourceClass, translations);
// Write out the properties file
PropertiesBuilder properties = new PropertiesBuilder();
properties.addAll(resourceClass, validated);
File resourceFile = resourceClass.getResourceFile(translations.getLanguage());
if (properties.getMissingCount() > 0) {
System.err.println(resourceFile.getName() + " is missing " + properties.getMissingCount() + " translations.");
}
Files.write(properties.toString(), resourceFile, Charsets.UTF_8);
System.err.println("Updated " + resourceFile.getName());
}
Aggregations