]> git.lyx.org Git - features.git/commitdiff
Avoid requiring messages with empty language.
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 15 Apr 2015 13:27:05 +0000 (15:27 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 15 Apr 2015 13:31:41 +0000 (15:31 +0200)
This is a follow-up to commit 8aa2d6b1.

src/frontends/qt4/GuiApplication.cpp

index ee2ecbcb8b62ef1e9f472bafe9ef4164bfa5b305..94c63461c106aadb5b07053bd6e1917847582882 100644 (file)
@@ -200,15 +200,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");
 }