QTfrontend/pageoptions.cpp
changeset 5238 46ddaf14509d
parent 5229 148d581b17ab
child 5252 ded882439548
--- a/QTfrontend/pageoptions.cpp	Sun Jun 12 14:45:26 2011 -0400
+++ b/QTfrontend/pageoptions.cpp	Sun Jun 12 21:06:48 2011 -0400
@@ -207,8 +207,8 @@
 
             CBLanguage = new QComboBox(groupMisc);
             QDir tmpdir;
-            tmpdir.cd(datadir->absolutePath());
-            tmpdir.cd("Locale");
+            tmpdir.cd(cfgdir->absolutePath());
+            tmpdir.cd("Data/Locale");
             tmpdir.setFilter(QDir::Files);
             QStringList locs = tmpdir.entryList(QStringList("hedgewars_*.qm"));
             CBLanguage->addItem(QComboBox::tr("(System default)"), QString(""));
@@ -218,6 +218,17 @@
                 CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", loc.name());
             }
 
+            tmpdir.cd(datadir->absolutePath());
+            tmpdir.cd("Locale");
+            tmpdir.setFilter(QDir::Files);
+            QStringList tmplist = tmpdir.entryList(QStringList("hedgewars_*.qm"));
+            for(int i = 0; i < tmplist.count(); i++)
+            {
+                if (locs.contains(tmplist[i])) continue;
+                QLocale loc(tmplist[i].replace(QRegExp("hedgewars_(.*)\\.qm"), "\\1"));
+                CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", loc.name());
+            }
+
             MiscLayout->addWidget(CBLanguage, 2, 1);
 
             CBAltDamage = new QCheckBox(groupMisc);