This is a discussion on i18n problem, involving Locale.getDisplayLanguage and Locale.getDisplayCountry - Java ; LS, concider the following (ran on a winxp machine under jdk1.3.1) 1: out.println(new Locale("nl", "BE").getDisplayLanguage(new Locale("en", "US"))) > Belgium 2: out.println(new Locale("nl", "BE").getDisplayLanguage(new Locale("nl", "NL"))) > België 3: out.println(new Locale("en", "US").getDisplayLanguage(new Locale("en", "US"))) > english 4: out.println(new Locale("en", "US").getDisplayLanguage(new Locale("nl", ...
LS,
concider the following (ran on a winxp machine under jdk1.3.1)
1: out.println(new Locale("nl", "BE").getDisplayLanguage(new Locale("en",
"US")))
> Belgium
2: out.println(new Locale("nl", "BE").getDisplayLanguage(new Locale("nl",
"NL")))
> België
3: out.println(new Locale("en", "US").getDisplayLanguage(new Locale("en",
"US")))
> english
4: out.println(new Locale("en", "US").getDisplayLanguage(new Locale("nl",
"NL")))
> english
line 1, 2 and 3 function properly
line 4 doesn't, I would expect "engels" (which is the dutch translation of
"english")
we already determined this behaviour is caused by the
<java_home>/jre/lib/i18n.jar, which isn't fitted with al of the language
specific details.
We know this because when I unpack the jar, decompile the class
java.text.resources.LocaleElements_nl, add translation "engels"* and compile
and jar again, line 4 functions properly
my question is as follows:
Does anybody know the proper way to do this, eg: without decompiling the
i18n.jar
I can't imagine sun proposes such a way.
I can't find any references to how this should be done properly.
Maurice Hulsman
maurice.hulsman@indicia.nl
*) if somebody would like to know exactly what we did, you can always ask