From 2d69d4a5ef5f2d3e777d77380732c333151fe949 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 9 Oct 2013 17:55:31 -0700 Subject: [PATCH] Make sure we handle untranslated Subsurface correctly At least on the Mac we otherwise switch to the next language which is not what the user likely intended. Signed-off-by: Dirk Hohndel --- qt-gui.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qt-gui.cpp b/qt-gui.cpp index ac739ad6f..532d1b509 100644 --- a/qt-gui.cpp +++ b/qt-gui.cpp @@ -85,7 +85,10 @@ void init_ui(int *argcp, char ***argvp) xslt_path = strdup(getSubsurfaceDataPath("xslt").toAscii().data()); QLocale loc; - if (loc.uiLanguages().first() != "en-US") { + // we don't have translations for English - if we don't check for this + // Qt will proceed to load the second language in preference order - not what we want + // on Linux this tends to be en-US, but on the Mac it's just en + if (!loc.uiLanguages().first().startsWith("en")) { qtTranslator = new QTranslator; if (qtTranslator->load(loc,"qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath))) { application->installTranslator(qtTranslator);