1 |
/* Locale.java -- i18n locales |
/* Locale.java -- i18n locales |
2 |
Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. |
Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
39 |
package java.util; |
package java.util; |
40 |
|
|
41 |
import gnu.classpath.SystemProperties; |
import gnu.classpath.SystemProperties; |
|
import gnu.java.locale.LocaleHelper; |
|
42 |
|
|
43 |
import java.io.IOException; |
import java.io.IOException; |
44 |
import java.io.ObjectInputStream; |
import java.io.ObjectInputStream; |
662 |
*/ |
*/ |
663 |
public String getDisplayLanguage(Locale inLocale) |
public String getDisplayLanguage(Locale inLocale) |
664 |
{ |
{ |
665 |
return LocaleHelper.getLocalizedString(inLocale, language, |
try |
666 |
"languages", true, false); |
{ |
667 |
|
ResourceBundle res = |
668 |
|
ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", |
669 |
|
inLocale, |
670 |
|
ClassLoader.getSystemClassLoader()); |
671 |
|
|
672 |
|
return res.getString("languages." + language); |
673 |
|
} |
674 |
|
catch (MissingResourceException e) |
675 |
|
{ |
676 |
|
return language; |
677 |
|
} |
678 |
} |
} |
679 |
|
|
680 |
/** |
/** |
720 |
*/ |
*/ |
721 |
public String getDisplayCountry(Locale inLocale) |
public String getDisplayCountry(Locale inLocale) |
722 |
{ |
{ |
723 |
return LocaleHelper.getLocalizedString(inLocale, country, |
try |
724 |
"territories", true, false); |
{ |
725 |
|
ResourceBundle res = |
726 |
|
ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", |
727 |
|
inLocale, |
728 |
|
ClassLoader.getSystemClassLoader()); |
729 |
|
|
730 |
|
return res.getString("territories." + country); |
731 |
|
} |
732 |
|
catch (MissingResourceException e) |
733 |
|
{ |
734 |
|
return country; |
735 |
|
} |
736 |
} |
} |
737 |
|
|
738 |
/** |
/** |
779 |
*/ |
*/ |
780 |
public String getDisplayVariant(Locale inLocale) |
public String getDisplayVariant(Locale inLocale) |
781 |
{ |
{ |
782 |
return LocaleHelper.getLocalizedString(inLocale, variant, "variants", |
try |
783 |
true, false); |
{ |
784 |
|
ResourceBundle res = |
785 |
|
ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", |
786 |
|
inLocale, |
787 |
|
ClassLoader.getSystemClassLoader()); |
788 |
|
|
789 |
|
return res.getString("variants." + variant); |
790 |
|
} |
791 |
|
catch (MissingResourceException e) |
792 |
|
{ |
793 |
|
return variant; |
794 |
|
} |
795 |
} |
} |
796 |
|
|
797 |
/** |
/** |