[loc-en-dev] Definition of "candidate locales"
y.umaoka at gmail.com
Tue May 26 14:55:09 PDT 2009
The API doc for ResourceBundle.Control#getCandidateLocales says -
The sequence of the candidate locales also corresponds to the runtime
resource lookup path (also known as the /parent chain/), if the
corresponding resource bundles for the candidate locales exist and their
parents are not defined by loaded resource bundles themselves. The last
element of the list must be a root locale
<http://java.sun.com/javase/6/docs/api/java/util/Locale.html#ROOT> if it
is desired to have the base bundle as the terminal of the parent chain.
According to the agreement in the former discussions, we are going to
introduce the special lookup path for supporting backward compatible
locales. For example, for a given locale "he_IL", the lookup path will
be "he_IL", "iw_IL", "he", "iw". The current ResourceBundle
implementation assumes that the lookup path is equivalent to the
ResourceBundle's parent chain. Therefore, when both he bundle and iw
budnle exist, ResourceBundle#getObject go through bundle he, then iw to
locate a resource. I'm wondering if we are OK with the behavior.
Another possible option is to separate the parent chain from the lookup
path - for this specific case, if "iw_IL" exist, the parent chain will
be "iw_IL", "iw" and ROOT. But if we want to go for this option, we
probably have to make this special case only for JDK's own Control
implementation. Anyway, I would like to raise this topic for discussion.
More information about the locale-enhancement-dev