1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-17 03:45:56 +01:00

uiLanguages returns strings with "-" as separators for language/region; however QTranslator needs "_" separators

This commit is contained in:
Arnaud Bienner 2012-11-05 19:35:02 +01:00
parent 3ff5608ca7
commit 4fd45e0028

View File

@ -120,7 +120,10 @@ void LoadTranslation(const QString& prefix, const QString& path,
#if QT_VERSION >= 0x040800
QString system_language = QLocale::system().uiLanguages().empty() ?
QLocale::system().name() : QLocale::system().uiLanguages()[0];
QLocale::system().name() : QLocale::system().uiLanguages().first();
// uiLanguages returns strings with "-" as separators for language/region;
// however QTranslator needs "_" separators
system_language.replace("-", "_");
#else
QString system_language = QLocale::system().name();
#endif