On 20.08.2012, at 14:51, Felix Meschberger <[email protected]> wrote:

> How about an extension:
> 
> * Multiple providers are supported
> * Each provider may indicate the supported locales

Reconsidering, I now think that might be the most stable approach. To make it 
simple, a ResourceBundleProvider [0] would not indicate its supported locales 
through a separate method, but they would simply be called in order (depending 
on service.ranking) and the first one returning something from a 
getResourceBundle() call would win.

Not sure what to do with getDefaultLocale(). Isn't that rather something for 
the (Request)LocaleResolver [1]? In the I18nFilter, which uses this method, 
it's used right next to the locale resolver and I think this one would be 
better suited to define the default. The provider's purpose is to provide 
dictionaries, but not to define what the default locale would be.

If you agree, I can open issues for those items and provide patches.

[0] 
http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/i18n/src/main/java/org/apache/sling/i18n/ResourceBundleProvider.java
[1] 
http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/i18n/src/main/java/org/apache/sling/i18n/RequestLocaleResolver.java

Cheers,
Alex

Reply via email to