You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2013/02/22 14:18:12 UTC

[jira] [Commented] (SLING-2536) JcrResourceBundle breaks the contract of getLocale

    [ https://issues.apache.org/jira/browse/SLING-2536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13584247#comment-13584247 ] 

Carsten Ziegeler commented on SLING-2536:
-----------------------------------------

If you request a resource bundle for a given locale, you get a resource bundle for that locale - whether the contents of this bundle is really in that language is a different thing. So if you request sv, you get a bundle for sv and getLocale() returns sv.
>From this pov, it works as designed.

Why do you need access to the locale which has been used to create this bundle?
                
> JcrResourceBundle breaks the contract of getLocale
> --------------------------------------------------
>
>                 Key: SLING-2536
>                 URL: https://issues.apache.org/jira/browse/SLING-2536
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: i18n 2.2.2
>            Reporter: Endolf
>
> The javadoc for getLocale state that it should return the locale of this bundle or the locale of the fallback. Currently JcrResourceBundle always returns the requested locale even if there is no mix:language for that locale.
> e.g. Only a mix:language with a jcr:language en is in the jcr, a request for a resource bundle of sv will return a ResourceBundle object where getLocale returns sv. This should return en according to the javadoc.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira