supporting language
Hi All,
I have a web application that recieves a list of possible locales from the client and according to the locale presents the UI language.
I would lik to add a mechanism that will allow me to first check the locale, verify if i support the locale's language(- resources files for htat language are current) and than :
if the language supported - use it else, use the next locale in the locales list.
Thanks,
Edoron
> I would lik to add a mechanism that will allow me to
> first check the locale, verify if i support the
> locale's language(- resources files for htat language
> are current) and than :
> if the language supported - use it else, use the next
> locale in the locales list.
So, you don't just want to use the built-in fallback mechanism (if no resource bundles are found for the requested locale, the next one on the list is used, etc.). You want to check whether the resource files for a certain language are "current". What is that criterion exactly, and how do you verify it? That would be the first question to answer - and not an easy one, I think.
Let's say the content of a certain key/value pair has been updated in the base resource bundle, but none of the other resource bundles have yet been updated with the new content - that would make them 'not current', I guess, but how would you verify that?
Hi,
the automatic Collapse mechanism collapses according to a speciefic locale , for example if it was givven a en_US locale it will look for a en_US locale if not found en locale and if not found the OS Default locale.
i am interested in a different fallback mechanism where it is folding back according to a locale list i give him.
Regards,
Edoron.
Have you looked at the getCandidateLocales method in Java SE 6:
http://download.java.net/jdk6/docs/api/java/util/ResourceBundle.Control.html
This statement would seem to be promising for your purposes:
"The default implementation uses an ArrayList that overriding implementations may modify before returning it to the caller."