i18n: better approach to load translations

This commit is contained in:
Gary Wang 2023-08-26 23:39:34 +08:00
parent 248f889cb3
commit e927708f78
No known key found for this signature in database
GPG Key ID: 5D30A4F15EA78760

View File

@ -34,7 +34,7 @@ int main(int argc, char *argv[])
#else #else
qmDir = QT_STRINGIFY(QM_FILE_INSTALL_DIR); qmDir = QT_STRINGIFY(QM_FILE_INSTALL_DIR);
#endif #endif
if (translator.load(QString("PineapplePictures_%1").arg(QLocale::system().name()), qmDir)) { if (translator.load(QLocale(), QLatin1String("PineapplePictures"), QLatin1String("_"), qmDir)) {
a.installTranslator(&translator); a.installTranslator(&translator);
} }
a.setApplicationName("Pineapple Pictures"); a.setApplicationName("Pineapple Pictures");