commit 839f37317f1f4d910bb8bbfa416ebcbda7761947
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Wed Apr 15 15:27:05 2015 +0200
Avoid requiring messages with empty language.
This is a follow-up to commit 8aa2d6b1.
diff --git a/src/frontends/qt4/GuiApplication.cpp
b/src/frontends/qt4/GuiApplication.cpp
index fdd9745..cf359d6 100644
--- a/src/frontends/qt4/GuiApplication.cpp
+++ b/src/frontends/qt4/GuiApplication.cpp
@@ -189,15 +189,13 @@ void setLocale()
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);
- code = l ? l->code() : string();
+ code = l ? l->code() : "C";
theLocale = QLocale(toqstr(code));
}
- Messages::guiLanguage(code);
+ // Qt tries to outsmart us and transforms en_US to C.
+ Messages::guiLanguage((code == "C") ? "en_US" : code);
QLocale::setDefault(theLocale);
setlocale(LC_NUMERIC, "C");
}