[
https://issues.apache.org/jira/browse/SLING-5137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Radu Cotescu closed SLING-5137.
-------------------------------
> 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
> Affects Versions: Scripting Sightly Engine 1.0.0
> Reporter: Michael Kreis
> Assignee: Radu Cotescu
> Fix For: Scripting Sightly Engine 1.0.16
>
>
> When using a locale option with country in an i18n sightly expression, e.g.
> {noformat}
> ${'label.key' @ i18n, locale='de_CH'}
> {noformat}
> 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)