From: Jean-Marc Lasgouttes Date: Tue, 17 Mar 2015 10:34:28 +0000 (+0100) Subject: Fix setting Interlingua as GUI language X-Git-Tag: 2.2.0alpha1~1146 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8aa2d6b18415659e147bfb4039e371a3277226d5;p=features.git Fix setting Interlingua as GUI language The problem came from the fact that Qt associates Interlingua to locale C. Now, we do not rely anymore on the Qt locale to set the language. I suspect that the problem will still exist if the system locale is ia_IA. Fixes bug #9267. --- diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 39b73cf062..f858d85c90 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -192,16 +192,19 @@ frontend::Application * createApplication(int & argc, char * argv[]) void setLocale() { QLocale theLocale; + string code; if (lyxrc.gui_language == "auto") { theLocale = QLocale::system(); + code = fromqstr(theLocale.name()); + // Qt tries to outsmart us and transforms en_US to C. + if (code == "C") + code = "en_US"; } else { Language const * l = languages.getLanguage(lyxrc.gui_language); - string const code = l ? l->code() : string(); + code = l ? l->code() : string(); theLocale = QLocale(toqstr(code)); } - string const code = fromqstr(theLocale.name()); - // Qt tries to outsmart us and transforms en_US to C. - Messages::guiLanguage((code == "C") ? "en_US" : code); + Messages::guiLanguage(code); QLocale::setDefault(theLocale); setlocale(LC_NUMERIC, "C"); }