Search in sources :

Example 1 with PolyStringTranslationArgumentType

use of com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationArgumentType in project midpoint by Evolveum.

the class LocalizationServiceImpl method translate.

private String translate(PolyStringTranslationType translation, Locale locale) {
    String key = translation.getKey();
    if (StringUtils.isEmpty(key)) {
        return translateFromFallback(translation, locale, key);
    }
    String result;
    List<PolyStringTranslationArgumentType> arguments = translation.getArgument();
    if (arguments == null) {
        result = translate(key, null, locale, key);
    } else {
        result = translate(key, arguments.toArray(), locale, key);
    }
    if (result != null) {
        return result;
    } else {
        return translateFromFallback(translation, locale, null);
    }
}
Also used : PolyStringTranslationArgumentType(com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationArgumentType) PolyString(com.evolveum.midpoint.prism.polystring.PolyString)

Example 2 with PolyStringTranslationArgumentType

use of com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationArgumentType in project midpoint by Evolveum.

the class LocalizationServiceImpl method translate.

private String translate(PolyStringTranslationArgumentType polyStringTranslationArgument, Locale locale) {
    String value = polyStringTranslationArgument.getValue();
    if (value != null) {
        return value;
    }
    PolyStringTranslationType translation = polyStringTranslationArgument.getTranslation();
    if (translation != null) {
        return translate(translation, locale);
    }
    return null;
}
Also used : PolyString(com.evolveum.midpoint.prism.polystring.PolyString) PolyStringTranslationType(com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationType)

Aggregations

PolyString (com.evolveum.midpoint.prism.polystring.PolyString)2 PolyStringTranslationArgumentType (com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationArgumentType)1 PolyStringTranslationType (com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationType)1