diff options
-rw-r--r-- | src/qt/bitcoin.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index c20a1dda97..654fb5bc4f 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -139,12 +139,17 @@ static void initTranslations(QTranslator &qtTranslatorBase, QTranslator &qtTrans // - First load the translator for the base language, without territory // - Then load the more specific locale translator +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) + const QString translation_path{QLibraryInfo::location(QLibraryInfo::TranslationsPath)}; +#else + const QString translation_path{QLibraryInfo::path(QLibraryInfo::TranslationsPath)}; +#endif // Load e.g. qt_de.qm - if (qtTranslatorBase.load("qt_" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) + if (qtTranslatorBase.load("qt_" + lang, translation_path)) QApplication::installTranslator(&qtTranslatorBase); // Load e.g. qt_de_DE.qm - if (qtTranslator.load("qt_" + lang_territory, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) + if (qtTranslator.load("qt_" + lang_territory, translation_path)) QApplication::installTranslator(&qtTranslator); // Load e.g. bitcoin_de.qm (shortcut "de" needs to be defined in bitcoin.qrc) |