Replace locale no-NO by nb-NO. Bug 533814, r=pike
authorSimon Montagu <smontagu@smontagu.org>
Tue, 22 Dec 2009 04:53:05 -0800
changeset 36542 195db4224a601cda5f8a07d23b0175c647759766
parent 36541 85c3437867aed3a3336035e583c85c1dd3b0301f
child 36544 10050c1a0b32bdc2debdb55f7c423345a2dd23fa
child 36564 19c81ca38ab4b774bd0e8cf7cd3958709ed9aaf6
push idunknown
push userunknown
push dateunknown
reviewerspike
bugs533814
milestone1.9.3a1pre
Replace locale no-NO by nb-NO. Bug 533814, r=pike
intl/locale/src/unix/nsPosixLocale.cpp
--- a/intl/locale/src/unix/nsPosixLocale.cpp
+++ b/intl/locale/src/unix/nsPosixLocale.cpp
@@ -111,16 +111,22 @@ nsPosixLocale::GetXPLocale(const char* p
     }
     if (!ParseLocaleString(posixLocale,lang_code,country_code,extra,'_')) {
 //      * locale = "x-user-defined";
       // use posix if parse failed
       CopyASCIItoUTF16(nsDependentCString(posixLocale), locale);
       return NS_OK;
     }
 
+    // Special case: substitute "nb" (Norwegian Bokmal) for macrolanguage
+    // code "no" (Norwegian)
+    if (nsDependentCString(lang_code).LowerCaseEqualsLiteral("no")) {
+      lang_code[1] = 'b';
+    }
+
     if (*country_code) {
       PR_snprintf(posix_locale,sizeof(posix_locale),"%s-%s",lang_code,country_code);
     } 
     else {
       PR_snprintf(posix_locale,sizeof(posix_locale),"%s",lang_code);
     }
 
     CopyASCIItoUTF16(nsDependentCString(posix_locale), locale);