use of com.developmentontheedge.be5.metadata.model.LanguageLocalizations in project be5 by DevelopmentOnTheEdge.
the class ProjectGenerator method setLanguages.
private void setLanguages(final Project project) {
for (final String language : parameters.getLanguages()) {
final Localizations localizations = project.getApplication().getLocalizations();
final LanguageLocalizations languageLocalizations = new LanguageLocalizations(language, localizations);
DataElementUtils.saveQuiet(languageLocalizations);
}
}
use of com.developmentontheedge.be5.metadata.model.LanguageLocalizations in project be5 by DevelopmentOnTheEdge.
the class Serialization method reloadLocalization.
public static LanguageLocalizations reloadLocalization(final Path file, final Localizations localizations) throws ReadException {
checkProject(localizations.getProject());
turnOffAutomaticSerialization();
try {
return new YamlDeserializer(new LoadContext()).reloadLocalization(file, localizations);
} finally {
turnOnAutomaticSerialization();
}
}
use of com.developmentontheedge.be5.metadata.model.LanguageLocalizations in project be5 by DevelopmentOnTheEdge.
the class MetaImpl method getLocalization.
private String getLocalization(Project project, String language, String entity, Predicate<LocalizationElement> accept) {
for (Module module : project.getModulesAndApplication()) {
Localizations localizations = module.getLocalizations();
LanguageLocalizations languageLocalizations = localizations.get(language);
if (languageLocalizations == null)
continue;
EntityLocalizations entityLocalizations = languageLocalizations.get(entity);
if (entityLocalizations == null)
continue;
for (LocalizationElement element : entityLocalizations.elements()) if (accept.test(element))
return element.getValue();
}
return "";
}
use of com.developmentontheedge.be5.metadata.model.LanguageLocalizations in project be5 by DevelopmentOnTheEdge.
the class YamlSerializer method serialize.
public void serialize(final LanguageLocalizations languageLocalizations) throws WriteException {
this.fileSystem = new ProjectFileSystem(languageLocalizations.getProject());
new LocalizationSerializer().serialize(languageLocalizations);
}
Aggregations