aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorMojo Jojo <mojojojo@pacbell.net>1999-08-06 08:38:50 +0000
committerTom Tromey <tromey@gcc.gnu.org>1999-08-06 08:38:50 +0000
commit3a6bdebaa06c757b5d41c8fffd2f1f4048ea0156 (patch)
tree94d741cf958c64772347e27135536a12c18f3615 /libjava
parent2dbd129523e2fbc4c67b3f612f0219dc1580db76 (diff)
downloadgcc-3a6bdebaa06c757b5d41c8fffd2f1f4048ea0156.zip
gcc-3a6bdebaa06c757b5d41c8fffd2f1f4048ea0156.tar.gz
gcc-3a6bdebaa06c757b5d41c8fffd2f1f4048ea0156.tar.bz2
Locale.java (CHINESE, [...]): New locales.
1999-08-06 Mojo Jojo <mojojojo@pacbell.net> * java/util/Locale.java, CHINESE, ENGLISH, FRENCH, GERMAN, ITALIAN, JAPANESE, KOREAN, CANADA_FRENCH, GERMANY, ITALY, KOREA, SIMPLIFIED_CHINESE, TRADITIONAL_CHINESE, PRC, TAIWAN, CHINA): New locales. (toString): Print correctly when `country' is empty. From-SVN: r28548
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog8
-rw-r--r--libjava/java/util/Locale.java36
2 files changed, 39 insertions, 5 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 81e7d8d..4e367a9 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,11 @@
+1999-08-06 Mojo Jojo <mojojojo@pacbell.net>
+
+ * java/util/Locale.java, CHINESE, ENGLISH, FRENCH, GERMAN,
+ ITALIAN, JAPANESE, KOREAN, CANADA_FRENCH, GERMANY, ITALY, KOREA,
+ SIMPLIFIED_CHINESE, TRADITIONAL_CHINESE, PRC, TAIWAN, CHINA): New
+ locales.
+ (toString): Print correctly when `country' is empty.
+
1999-08-04 Per Bothner <per@bothner.com>
* configure.in: Also do AC_SUBST for DIVIDESPEC.
diff --git a/libjava/java/util/Locale.java b/libjava/java/util/Locale.java
index 6278414..77bf0e3 100644
--- a/libjava/java/util/Locale.java
+++ b/libjava/java/util/Locale.java
@@ -27,13 +27,36 @@ public final class Locale implements java.io.Serializable, Cloneable
private String variant;
private static Locale defaultLocale;
- // FIXME: many are still missing.
+ // These are as specified in the JDK 1.2 AP documentation
+
+
+ // LANGUAGE constants ... country-neutral
+ public static final Locale CHINESE = new Locale ("zh", "");
+ public static final Locale ENGLISH = new Locale ("en", "");
+ public static final Locale FRENCH = new Locale ("fr", "");
+ public static final Locale GERMAN = new Locale ("de", "");
+ public static final Locale ITALIAN = new Locale ("it", "");
+ public static final Locale JAPANESE = new Locale ("ja", "");
+ public static final Locale KOREAN = new Locale ("ko", "");
+
+ // COUNTRY constants ... countries can be multi-lingual
public static final Locale CANADA = new Locale ("en", "CA");
+ public static final Locale CANADA_FRENCH = new Locale ("fr", "CA");
public static final Locale FRANCE = new Locale ("fr", "FR");
+ public static final Locale GERMANY = new Locale ("de", "DE");
+ public static final Locale ITALY = new Locale ("it", "IT");
public static final Locale JAPAN = new Locale ("ja", "JP");
+ public static final Locale KOREA = new Locale ("ko", "KR");
public static final Locale UK = new Locale ("en", "GB");
public static final Locale US = new Locale ("en", "US");
+ // Chinese has multiple scripts and political bodies
+ public static final Locale SIMPLIFIED_CHINESE = new Locale ("zh", "CN");
+ public static final Locale TRADITIONAL_CHINESE = new Locale ("zh", "TW");
+ public static final Locale PRC = SIMPLIFIED_CHINESE;
+ public static final Locale TAIWAN = TRADITIONAL_CHINESE;
+ public static final Locale CHINA = PRC;
+
public Locale (String languageCode, String countryCode)
{
this (languageCode, countryCode, "");
@@ -114,12 +137,15 @@ public final class Locale implements java.io.Serializable, Cloneable
{
StringBuffer result = new StringBuffer(20);
result.append(language);
- result.append('_');
- result.append(country);
- if (variant.length() > 0)
+ if (country.length() > 0)
{
result.append('_');
- result.append(variant);
+ result.append(country);
+ if (variant.length() > 0)
+ {
+ result.append('_');
+ result.append(variant);
+ }
}
return result.toString();
}