From 59d88dd2de3a68547a7b1b91e8c8700433cba1d6 Mon Sep 17 00:00:00 2001 From: Jiachen Yang Date: Sun, 12 Aug 2018 18:39:42 +0900 Subject: [PATCH] fix auto locale detection (#308) Current implementation QLocale::system.language() will not correctly differs Simplified Chinese with Traditional Chinese, which is causing problems to load translations for zh_TW. This fix the problem by following the documentation here: https://doc.qt.io/qt-5/qtranslator.html#load-1 --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index d1b318ea..83fa1c1a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) { QStringList trPaths = PathInfo::translationsPaths(); for (const QString &path: trPaths) { - bool match = translator.load(QLocale::system().language(), + bool match = translator.load(QLocale(), "Internationalization", "_", path); if (match) {