[
https://issues.apache.org/jira/browse/SLING-5137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15172601#comment-15172601
]
Radu Cotescu commented on SLING-5137:
-------------------------------------
Throwing an exception in this case would be a change of behaviour which I find
more problematic than for the {{data-sly-*}} block elements. Check the previous
version of the code:
https://github.com/apache/sling/blob/d7e96b89542bd85bbd7bd69adc33e367a8e69510/bundles/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/I18nRuntimeExtension.java
> 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.
> ${'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)