Michael Kreis created SLING-5137:
------------------------------------

             Summary: Locale in Sightly I18N RuntimeExtension is not used 
correctly
                 Key: SLING-5137
                 URL: https://issues.apache.org/jira/browse/SLING-5137
             Project: Sling
          Issue Type: Bug
          Components: Scripting
            Reporter: Michael Kreis


When using a locale option with country in an i18n sightly expression (e.g. 
${'label.key' @ i18n, locale='de_CH'}) the locale is not created correctly. 
See following line:
https://github.com/apache/sling/blob/trunk/bundles/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/I18nRuntimeExtension.java#L84
new Locale(locale) only sets the language but never a country.
Should use something like Apache Commons LocaleUtils.toLocale() 
(https://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/LocaleUtils.html#toLocale(java.lang.String))




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to