diff options
-rw-r--r-- | core/qt-init.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/core/qt-init.cpp b/core/qt-init.cpp index 587ace9a1..18f9a6ef7 100644 --- a/core/qt-init.cpp +++ b/core/qt-init.cpp @@ -86,13 +86,22 @@ void init_qt_late() #else translationLocation = QLibraryInfo::location(QLibraryInfo::TranslationsPath); #endif - if (qtTranslator.load(loc, "qtbase", "_", translationLocation) || - qtTranslator.load(loc, "qtbase", "_", getSubsurfaceDataPath("translations")) || - qtTranslator.load(loc, "qtbase", "_", getSubsurfaceDataPath("../translations"))) { - application->installTranslator(&qtTranslator); - } else { - if (uiLang != "en_US" && uiLang != "en-US") - qDebug() << "can't find Qt base localization for locale" << uiLang << "searching in" << translationLocation; + if (uiLang != "en_US" && uiLang != "en-US") { + if (qtTranslator.load(loc, "qtbase", "_", translationLocation) || + qtTranslator.load(loc, "qtbase", "_", getSubsurfaceDataPath("translations")) || + qtTranslator.load(loc, "qtbase", "_", getSubsurfaceDataPath("../translations"))) { + application->installTranslator(&qtTranslator); + } else { + // it's possible that this is one of the couple of languages that still have qt_XX translations + // and no qtbase_XX translations - as of this writing this is true for Swedish and Portuguese + if (qtTranslator.load(loc, "qt", "_", translationLocation) || + qtTranslator.load(loc, "qt", "_", getSubsurfaceDataPath("translations")) || + qtTranslator.load(loc, "qt", "_", getSubsurfaceDataPath("../translations"))) { + application->installTranslator(&qtTranslator); + } else { + qDebug() << "can't find Qt base localization for locale" << uiLang << "searching in" << translationLocation; + } + } } if (ssrfTranslator.load(loc, "subsurface", "_") || ssrfTranslator.load(loc, "subsurface", "_", translationLocation) || |