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:
parent
3f51d0b8b2
commit
ad73447dc2
1 changed files with 7 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue