fix 'failed to install translation' message when misc/locale in hedgewars.ini is empty (which is *always* when 'system default' is selected)
--- a/QTfrontend/main.cpp Sat Apr 06 01:19:47 2013 +0200
+++ b/QTfrontend/main.cpp Sat Apr 06 02:11:02 2013 +0200
@@ -267,12 +267,13 @@
{
QSettings settings("physfs://hedgewars.ini", QSettings::IniFormat);
QString cc = settings.value("misc/locale", QString()).toString();
- if(cc.isEmpty())
- cc = QLocale::system().name();
+ if (cc.isEmpty())
+ cc = HWApplication::keyboardInputLocale().name();
+ // QLocale::system().name() returns only "C"...
// load locale file into translator
- if(!Translator.load(QString("physfs://Locale/hedgewars_%1").arg(cc)))
- qWarning("Failed to install translation");
+ if (!Translator.load(QString("physfs://Locale/hedgewars_%1").arg(cc)))
+ qWarning("Failed to install translation (%s)", qPrintable(cc));
app.installTranslator(&Translator);
}