Search in sources :

Example 1 with LocalizationElement

use of com.developmentontheedge.be5.metadata.model.LocalizationElement 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 "";
}
Also used : EntityLocalizations(com.developmentontheedge.be5.metadata.model.EntityLocalizations) LanguageLocalizations(com.developmentontheedge.be5.metadata.model.LanguageLocalizations) EntityLocalizations(com.developmentontheedge.be5.metadata.model.EntityLocalizations) LanguageLocalizations(com.developmentontheedge.be5.metadata.model.LanguageLocalizations) Localizations(com.developmentontheedge.be5.metadata.model.Localizations) Module(com.developmentontheedge.be5.metadata.model.Module) LocalizationElement(com.developmentontheedge.be5.metadata.model.LocalizationElement)

Aggregations

EntityLocalizations (com.developmentontheedge.be5.metadata.model.EntityLocalizations)1 LanguageLocalizations (com.developmentontheedge.be5.metadata.model.LanguageLocalizations)1 LocalizationElement (com.developmentontheedge.be5.metadata.model.LocalizationElement)1 Localizations (com.developmentontheedge.be5.metadata.model.Localizations)1 Module (com.developmentontheedge.be5.metadata.model.Module)1