8030696: Norwegian locales nb_NO and nn_NO should be available locales
authornaoto
Fri, 31 Jan 2014 10:04:16 -0800
changeset 22627 93f110be9439
parent 22626 758d413359c4
child 22628 9186623f7045
8030696: Norwegian locales nb_NO and nn_NO should be available locales Reviewed-by: okutsu
jdk/make/gensrc/GensrcLocaleDataMetaInfo.gmk
jdk/src/share/classes/sun/util/resources/no/LocaleNames_no.properties
jdk/src/share/classes/sun/util/resources/no/LocaleNames_no_NO_NY.properties
jdk/test/java/util/Locale/LocaleTest.java
--- a/jdk/make/gensrc/GensrcLocaleDataMetaInfo.gmk	Thu Jan 30 00:02:46 2014 +0400
+++ b/jdk/make/gensrc/GensrcLocaleDataMetaInfo.gmk	Fri Jan 31 10:04:16 2014 -0800
@@ -53,8 +53,8 @@
 # The EN locales
 EN_LOCALES := en%
 
-# ja-JP-JP and th-TH-TH need to be manually added, as they don't have any resource files.
-ALL_NON_EN_LOCALES := ja-JP-JP th-TH-TH
+# Locales that don't have any resource files should be included here.
+ALL_NON_EN_LOCALES := ja-JP-JP nb-NO nn-NO th-TH-TH
 
 SED_ARGS := -e 's|$(HASH)warn This file is preprocessed before being compiled|// -- This file was mechanically generated: Do not edit! -- //|g'
 
--- a/jdk/src/share/classes/sun/util/resources/no/LocaleNames_no.properties	Thu Jan 30 00:02:46 2014 +0400
+++ b/jdk/src/share/classes/sun/util/resources/no/LocaleNames_no.properties	Fri Jan 31 10:04:16 2014 -0800
@@ -38,6 +38,8 @@
 # language names
 # key is ISO 639 language code
 
+nb=bokm\u00e5l
+nn=nynorsk
 no=norsk
 
 # country names
--- a/jdk/src/share/classes/sun/util/resources/no/LocaleNames_no_NO_NY.properties	Thu Jan 30 00:02:46 2014 +0400
+++ b/jdk/src/share/classes/sun/util/resources/no/LocaleNames_no_NO_NY.properties	Fri Jan 31 10:04:16 2014 -0800
@@ -38,12 +38,14 @@
 # language names
 # key is ISO 639 language code
 
+nb=bokm\u00e5l
+nn=nynorsk
 no=norsk
 
 # country names
 # key is ISO 3166 country code
 
-NO=Norge
+NO=Noreg
 
 
 # variant names
--- a/jdk/test/java/util/Locale/LocaleTest.java	Thu Jan 30 00:02:46 2014 +0400
+++ b/jdk/test/java/util/Locale/LocaleTest.java	Fri Jan 31 10:04:16 2014 -0800
@@ -25,7 +25,7 @@
  * @bug 4052404 4052440 4084688 4092475 4101316 4105828 4107014 4107953 4110613
  * 4118587 4118595 4122371 4126371 4126880 4135316 4135752 4139504 4139940 4143951
  * 4147315 4147317 4147552 4335196 4778440 4940539 5010672 6475525 6544471 6627549
- * 6786276 7066203 7085757
+ * 6786276 7066203 7085757 8030696
  * @summary test Locales
  */
 /*
@@ -62,6 +62,8 @@
  */
 
 import java.text.*;
+import java.util.Arrays;
+import java.util.List;
 import java.util.Locale;
 import java.util.MissingResourceException;
 import java.util.Date;
@@ -925,16 +927,20 @@
     }
 
     /*
-     * @bug 4147552 4778440
+     * @bug 4147552 4778440 8030696
      */
     public void Test4147552() {
         Locale[] locales = { new Locale("no", "NO"), new Locale("no", "NO", "B"),
-                             new Locale("no", "NO", "NY") };
+                             new Locale("no", "NO", "NY"), new Locale("nb", "NO"),
+                             new Locale("nn", "NO") };
         String[] englishDisplayNames = { "Norwegian (Norway)",
                      "Norwegian (Norway,Bokm\u00e5l)",
-                     "Norwegian (Norway,Nynorsk)" };
+                     "Norwegian (Norway,Nynorsk)",
+                     "Norwegian Bokm\u00e5l (Norway)",
+                     "Norwegian Nynorsk (Norway)" };
         String[] norwegianDisplayNames = { "norsk (Norge)",
-                     "norsk (Norge,bokm\u00e5l)", "norsk (Norge,nynorsk)" };
+                     "norsk (Norge,bokm\u00e5l)", "norsk (Noreg,nynorsk)",
+                     "bokm\u00e5l (Norge)", "nynorsk (Noreg)" };
 
         for (int i = 0; i < locales.length; i++) {
             Locale loc = locales[i];
@@ -948,6 +954,17 @@
         }
     }
 
+    /*
+     * @bug 8030696
+     */
+    public void Test8030696() {
+        List<Locale> av = Arrays.asList(Locale.getAvailableLocales());
+        if (!av.contains(new Locale("nb", "NO")) ||
+            !av.contains(new Locale("nn", "NO"))) {
+                errln("\"nb-NO\" and/or \"nn-NO\" locale(s) not returned from getAvailableLocales().");
+        }
+    }
+
     static String escapeUnicode(String s) {
         StringBuffer buf = new StringBuffer();
         for (int i=0; i<s.length(); ++i) {