linterna-magica-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linterna-magica-commit] [186] Various fixes for bugs in localisation lo


From: Ivaylo Valkov
Subject: [linterna-magica-commit] [186] Various fixes for bugs in localisation logic
Date: Sun, 07 Aug 2011 11:31:58 +0000

Revision: 186
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=186
Author:   valkov
Date:     2011-08-07 11:31:57 +0000 (Sun, 07 Aug 2011)
Log Message:
-----------
Various fixes for bugs in localisation logic

Modified Paths:
--------------
    trunk/src/lm_config_options.js
    trunk/src/lm_localisation.js

Modified: trunk/src/lm_config_options.js
===================================================================
--- trunk/src/lm_config_options.js      2011-08-07 10:35:35 UTC (rev 185)
+++ trunk/src/lm_config_options.js      2011-08-07 11:31:57 UTC (rev 186)
@@ -248,6 +248,11 @@
     // See lm_localisation.js
     this.set_env_lang();
 
+    if (/auto/i.test(locale))
+    {
+       locale = this.env_lang;
+    }
+
     // In case the country code is lowercase and the language code is
     // upper case
     if (/.*_.*/.test(locale))

Modified: trunk/src/lm_localisation.js
===================================================================
--- trunk/src/lm_localisation.js        2011-08-07 10:35:35 UTC (rev 185)
+++ trunk/src/lm_localisation.js        2011-08-07 11:31:57 UTC (rev 186)
@@ -57,6 +57,15 @@
        // Same as GNU IceCat & Firefox without translation
        env_lang = "en_US";
     }
+
+    // Some versions of GNU IceCat & Firefox report only two letters
+    // for the language. In this case we have to manually force the
+    // language to something useful and deducted.
+    if(!/[a-zA-Z]{2}(_|-)[a-zA-Z]{2}/.test(env_lang))
+    {
+       env_lang = env_lang.toLowerCase()+"_"+
+           env_lang.toUpperCase();
+    }
     
     // Epiphany uses only lowercase
     env_lang = env_lang.split(/_/);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]