Search in sources :

Example 1 with JsonTranslator

use of org.obiba.core.translator.JsonTranslator in project mica2 by obiba.

the class ExtendedResourceBundleMessageSource method resolveCodeWithoutArguments.

@Override
protected String resolveCodeWithoutArguments(String code, Locale locale) {
    String result = super.resolveCodeWithoutArguments(code, locale);
    if (result != null)
        return result;
    final String key = locale.getLanguage();
    JsonTranslator translator = getTranslator(key);
    if (translator != null) {
        try {
            result = translator.translate(code);
        } catch (Exception e) {
        // ignore
        }
    }
    return result;
}
Also used : JsonTranslator(org.obiba.core.translator.JsonTranslator) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 JsonTranslator (org.obiba.core.translator.JsonTranslator)1