diff options
author | saturneric <[email protected]> | 2024-01-25 16:26:52 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-01-25 16:26:52 +0000 |
commit | de356b281563855e627da449fcd842a0dbd49b0d (patch) | |
tree | 6e3a7e7952e1e024b7421c243305cb649acc4393 /src/ui/GpgFrontendUIInit.cpp | |
parent | fix: archive functions not work on windows when there were some non-ascii cha... (diff) | |
download | GpgFrontend-de356b281563855e627da449fcd842a0dbd49b0d.tar.gz GpgFrontend-de356b281563855e627da449fcd842a0dbd49b0d.zip |
feat: load buddled qt and qtbase translations
Diffstat (limited to 'src/ui/GpgFrontendUIInit.cpp')
-rw-r--r-- | src/ui/GpgFrontendUIInit.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ui/GpgFrontendUIInit.cpp b/src/ui/GpgFrontendUIInit.cpp index aa92488e..148402d4 100644 --- a/src/ui/GpgFrontendUIInit.cpp +++ b/src/ui/GpgFrontendUIInit.cpp @@ -220,6 +220,24 @@ void InitUITranslations() { QLocale().name()); QCoreApplication::installTranslator(translator); } + + auto* base_translation = new QTranslator(QCoreApplication::instance()); + if (base_translation->load(QLocale(), QLatin1String("qt"), QLatin1String("_"), + QLatin1String(":/i18n_qt"), + QLatin1String(".qm"))) { + GF_UI_LOG_DEBUG("load qt translation file done, locale: {}", + QLocale().name()); + QCoreApplication::installTranslator(base_translation); + } + + base_translation = new QTranslator(QCoreApplication::instance()); + if (base_translation->load(QLocale(), QLatin1String("qtbase"), + QLatin1String("_"), QLatin1String(":/i18n_qt"), + QLatin1String(".qm"))) { + GF_UI_LOG_DEBUG("load qtbase translation file done, locale: {}", + QLocale().name()); + QCoreApplication::installTranslator(base_translation); + } } } // namespace GpgFrontend::UI |