/[classpath]/classpath/java/util/Locale.java
ViewVC logotype

Diff of /classpath/java/util/Locale.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.27 by gnu_andrew, Wed Feb 16 20:54:25 2005 UTC revision 1.28 by mkoch, Thu May 19 06:45:04 2005 UTC
# Line 1  Line 1 
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    
# Line 39  exception statement from your version. * Line 39  exception statement from your version. *
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;
# Line 663  public final class Locale implements Ser Line 662  public final class Locale implements Ser
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    /**    /**
# Line 710  public final class Locale implements Ser Line 720  public final class Locale implements Ser
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    /**    /**
# Line 758  public final class Locale implements Ser Line 779  public final class Locale implements Ser
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    /**    /**

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26