Use old method of locale detection, fallback to new one in case of problems
authorunc0rr
Tue, 21 May 2013 21:22:32 +0400
changeset 9027 4b8e326251b3
parent 9025 95d59fad8699
child 9028 3a38c9453697
Use old method of locale detection, fallback to new one in case of problems
QTfrontend/main.cpp
--- a/QTfrontend/main.cpp	Tue May 21 11:32:42 2013 -0400
+++ b/QTfrontend/main.cpp	Tue May 21 21:22:32 2013 +0400
@@ -268,8 +268,13 @@
 
         QString cc = settings.value("misc/locale", QString()).toString();
         if (cc.isEmpty())
-            cc = HWApplication::keyboardInputLocale().name();
-            // QLocale::system().name() returns only "C"...
+        {
+            cc = QLocale::system().name();
+
+            // Fallback to current input locale if "C" locale is returned
+            if(cc == "C")
+                cc = HWApplication::keyboardInputLocale().name();
+        }
 
         // load locale file into translator
         if (!Translator.load(QString("physfs://Locale/hedgewars_%1").arg(cc)))