Store suffix of .qm files instead of locale name
authorunc0rr
Fri, 24 May 2013 01:12:41 +0400
changeset 9048 c58a9829e1cc
parent 9047 8edc79df026d
child 9049 69016523a7a2
Store suffix of .qm files instead of locale name
QTfrontend/ui/page/pageoptions.cpp
--- a/QTfrontend/ui/page/pageoptions.cpp	Thu May 23 09:33:36 2013 -0400
+++ b/QTfrontend/ui/page/pageoptions.cpp	Fri May 24 01:12:41 2013 +0400
@@ -587,11 +587,12 @@
             CBLanguage = new QComboBox(groupMisc);
             groupMisc->layout()->addWidget(CBLanguage, 0, 1);
             QStringList locs = DataManager::instance().entryList("Locale", QDir::Files, QStringList("hedgewars_*.qm"));
-            CBLanguage->addItem(QComboBox::tr("(System default)"), QString(""));
+            CBLanguage->addItem(QComboBox::tr("(System default)"), QString());
             for(int i = 0; i < locs.count(); i++)
             {
-                QLocale loc(locs[i].replace(QRegExp("hedgewars_(.*)\\.qm"), "\\1"));
-                CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", loc.name());
+                QString lname = locs[i].replace(QRegExp("hedgewars_(.*)\\.qm"), "\\1");
+                QLocale loc(lname);
+                CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", lname);
             }
 
             QLabel *restartNoticeLabel = new QLabel(groupMisc);