Name: boT120536 Date: 12/27/2000
Results are identical with 1.2.2 and 1.3, to wit:
% java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
% java -version
java version "1.2.2"
Java HotSpot(TM) Server VM (2.0fcs, mixed mode, build E)
Consider the set of java.util.Locale objects representing
English, French, Italian, German, Spanish and Portuguese (Brazillian)
A call to getDisplayName(inLocale) returns localized language names
only for English and French. For German, it returns localized names
for all but French. For the other languages, only the language
name itself is translated.
It appears that the i18n.jar that is shipped with the internationalized JDK/JRE
1.2.2 and 1.3.0 do not include the translated strings.
This causes concern among our European customers.
See the following program and its output.
import java.util.Locale;
public class LocaleNames {
public static void main(String args[]) {
Locale spanish = new Locale("es", "");
Locale brazillian_portuguese = new Locale("pt", "br");
// this could be written as a pair of loops but writing it like this
// makes it blindingly obvious what's going on.
test(Locale.US, Locale.US);
test(Locale.US, Locale.FRANCE);
test(Locale.US, Locale.GERMANY);
test(Locale.US, Locale.ITALIAN);
test(Locale.US, spanish);
test(Locale.US, brazillian_portuguese);
System.out.println();
test(Locale.FRANCE, Locale.US);
test(Locale.FRANCE, Locale.FRANCE);
test(Locale.FRANCE, Locale.GERMANY);
test(Locale.FRANCE, Locale.ITALIAN);
test(Locale.FRANCE, spanish);
test(Locale.FRANCE, brazillian_portuguese);
System.out.println();
test(Locale.GERMANY, Locale.US);
test(Locale.GERMANY, Locale.FRANCE);
test(Locale.GERMANY, Locale.GERMANY);
test(Locale.GERMANY, Locale.ITALIAN);
test(Locale.GERMANY, spanish);
test(Locale.GERMANY, brazillian_portuguese);
System.out.println();
test(Locale.ITALIAN, Locale.US);
test(Locale.ITALIAN, Locale.FRANCE);
test(Locale.ITALIAN, Locale.GERMANY);
test(Locale.ITALIAN, Locale.ITALIAN);
test(Locale.ITALIAN, spanish);
test(Locale.ITALIAN, brazillian_portuguese);
System.out.println();
test(spanish, Locale.US);
test(spanish, Locale.FRANCE);
test(spanish, Locale.GERMANY);
test(spanish, Locale.ITALIAN);
test(spanish, spanish);
test(spanish, brazillian_portuguese);
System.out.println();
test(brazillian_portuguese, Locale.US);
test(brazillian_portuguese, Locale.FRANCE);
test(brazillian_portuguese, Locale.GERMANY);
test(brazillian_portuguese, Locale.ITALIAN);
test(brazillian_portuguese, spanish);
test(brazillian_portuguese, brazillian_portuguese);
}
static void test(Locale inLocale, Locale nameToPrint) {
System.out.println("In " + inLocale.getDisplayLanguage() + ", " +
nameToPrint.getDisplayLanguage() + " translates to " +
nameToPrint.getDisplayLanguage(inLocale));
}
}
% java LocaleNames
In English, English translates to English
In English, French translates to French
In English, German translates to German
In English, Italian translates to Italian
In English, Spanish translates to Spanish
In English, Portuguese translates to Portuguese
In French, English translates to anglais
In French, French translates to fran?ais
In French, German translates to allemand
In French, Italian translates to italien
In French, Spanish translates to espagnol
In French, Portuguese translates to portugais
In German, English translates to Englisch
In German, French translates to French
In German, German translates to Deutsch
In German, Italian translates to Italienisch
In German, Spanish translates to Spanisch
In German, Portuguese translates to Portugiesisch
In Italian, English translates to English
In Italian, French translates to French
In Italian, German translates to German
In Italian, Italian translates to italiano
In Italian, Spanish translates to Spanish
In Italian, Portuguese translates to Portuguese
In Spanish, English translates to English
In Spanish, French translates to French
In Spanish, German translates to German
In Spanish, Italian translates to Italian
In Spanish, Spanish translates to espa?ol
In Spanish, Portuguese translates to Portuguese
In Portuguese, English translates to English
In Portuguese, French translates to French
In Portuguese, German translates to German
In Portuguese, Italian translates to Italian
In Portuguese, Spanish translates to Spanish
In Portuguese, Portuguese translates to portugu?s
(Review ID: 111387)
======================================================================