So, djfiander says "fix the code so it's not case-sensitive", so this seems to fix it.
authordbs <dbs@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 4 Feb 2009 03:55:56 +0000 (03:55 +0000)
committerdbs <dbs@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 4 Feb 2009 03:55:56 +0000 (03:55 +0000)
OpenSRF locale gets xx-YY, even though Dojo locale is xx-yy.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1651 9efc2488-bf62-4759-914b-345cdb29e865

src/javascript/DojoSRF.js

index 6b52594..e02ac98 100644 (file)
@@ -17,8 +17,15 @@ if(!dojo._hasResource['DojoSRF']){
                return this.session_cache[app];
        }
 
-       OpenSRF.locale = dojo.config.locale;
-       if (!OpenSRF.locale) {
-               OpenSRF.locale = dojo.isIE ? navigator.userLanguage : navigator.language;
-       }
+        localeRE = /^(\w\w)(-\w\w)?$/;
+        localeMatch = localeRE.exec(dojo.config.locale);
+
+        if (!localeMatch[1]) {
+                OpenSRF.locale = dojo.isIE ? navigator.userLanguage : navigator.language;
+        } else {
+                OpenSRF.locale = localeMatch[1].toLowerCase();
+        }
+        if (localeMatch[2]) {
+                OpenSRF.locale = OpenSRF.locale + '-' + localeMatch[2].toUpperCase();
+        }
 }