0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-03 09:56:38 -05:00

qt6: Do not use deprecated QLibraryInfo::path in Qt 6

See https://doc.qt.io/qt-6/qtcore-changes-qt6.html#other-classes
This commit is contained in:
Hennadii Stepanov 2022-06-21 13:39:26 +02:00
parent 3f51d0b8b2
commit ad73447dc2
No known key found for this signature in database
GPG key ID: 410108112E7EA81F

View file

@ -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)