mirror of
https://github.com/YACReader/yacreader
synced 2025-07-14 02:54:46 -04:00
Translations: Don't use QLocale::system::name
Older versions of the Qt documentation advocate using QLocale::system::name for system language resolving. This is deprecated and causes misbehavior, such as selecting the system unit language instead of system display language on Windows. Solution: Use QTranslator::load(QLocale(), ... ...), which is display language aware.
This commit is contained in:
committed by
Luis Ángel San Martín
parent
1243346e9a
commit
76a12cd7e3
@ -164,11 +164,10 @@ int main(int argc, char **argv)
|
||||
logger.addDestination(std::move(fileDestination));
|
||||
|
||||
QTranslator translator;
|
||||
QString sufix = QLocale::system().name();
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC
|
||||
translator.load(QString(DATADIR) + "/yacreader/languages/yacreaderlibrary_" + sufix);
|
||||
translator.load(QLocale(), "yacreaderlibrary", "_", QString(DATADIR) + "/yacreader/languages");
|
||||
#else
|
||||
translator.load(QCoreApplication::applicationDirPath() + "/languages/yacreaderlibrary_" + sufix);
|
||||
translator.load(QLocale(), "yacreaderlibrary", "_", "languages");
|
||||
#endif
|
||||
app.installTranslator(&translator);
|
||||
|
||||
|
Reference in New Issue
Block a user