[
https://issues.apache.org/jira/browse/SLING-8802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16960621#comment-16960621
]
Jörg Hoh commented on SLING-8802:
---------------------------------
Maybe I misunderstand your statement, but I don't want to change the behavior
of ResourceBundles on a highlevel.
At a lowlevel we have dictionaries, and dictionaries can be assigned a
basename. And the basename associated with a dictionary is used as the basename
in the ResourceBundle abstraction. And multiple dictionaries can be merged into
a single ResourceBundle.
And a ResourceBundle requested without basename (or with a {{null}} basename)
contains dictionaries which have or have not a basename associated. But if you
have a basename specified your ResourceBundles only contains the dictionaries
which have that specific basename set.
Or in other words: A ResourceBundle with a {{null}} basename contains the
content of all dictionaries of the locale, ignoring any basename property set.
Right now I don't see where this behavior is specified.
> JcrResourceBundle should not consider dictionaries with a basename, if no
> basename is provided
> ----------------------------------------------------------------------------------------------
>
> Key: SLING-8802
> URL: https://issues.apache.org/jira/browse/SLING-8802
> Project: Sling
> Issue Type: Improvement
> Components: i18n
> Affects Versions: i18n 2.5.14
> Reporter: Jörg Hoh
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> In a situation where 2 dictionaries are available (one with a basename
> configured, the other without any basename), the {{JcrResourceBundle}} will
> load (and merge) both if no basename is provided (see [1]).
> This breaks applications where basenames are used to separate multiple
> ResourceBundles from each other, and there are definitely cases where the
> basename is not provided (and thu assumed as {{null}}).
> I would propose to make the behavior consistent and return only dictionaries
> with no basename configured if basename is null.
> [1]
> https://github.com/apache/sling-org-apache-sling-i18n/blob/master/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java#L340
--
This message was sent by Atlassian Jira
(v8.3.4#803005)