uiLanguages returns strings with "-" as separators for language/region; however QTranslator needs "_" separators
This commit is contained in:
parent
3ff5608ca7
commit
4fd45e0028
|
@ -120,7 +120,10 @@ void LoadTranslation(const QString& prefix, const QString& path,
|
||||||
|
|
||||||
#if QT_VERSION >= 0x040800
|
#if QT_VERSION >= 0x040800
|
||||||
QString system_language = QLocale::system().uiLanguages().empty() ?
|
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
|
#else
|
||||||
QString system_language = QLocale::system().name();
|
QString system_language = QLocale::system().name();
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue