]> git.lyx.org Git - features.git/commitdiff
Move a Qt workaround to the Qt frontend.
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 3 Jun 2013 16:08:53 +0000 (18:08 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 4 Jun 2013 10:08:36 +0000 (12:08 +0200)
src/frontends/qt4/GuiApplication.cpp
src/support/Messages.cpp

index 19e9b2bdfe64975add9f27330183378c25414951..53fb170390edee744f5b987e20ed7e38ff6a4f1a 100644 (file)
@@ -186,7 +186,9 @@ void setLocale()
                string const code = l ? l->code() : string();
                theLocale = QLocale(toqstr(code));
        }
-       Messages::guiLanguage(fromqstr(theLocale.name()));
+       string const code = fromqstr(theLocale.name());
+       // 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");
 }
index 4eeea5f6897e8c11882b0cda7db9222567cfbd1d..906ec3b4c49df4e22229dcaa06a56a5e0e6edc90 100644 (file)
@@ -155,10 +155,8 @@ Messages::Messages(string const & l)
 namespace {
 
 // Find the code we have for a given language code. Return empty if not found.
-string realCode(string const & c)
+string realCode(string code)
 {
-       // Qt tries to outsmart us and transforms en_US to C.
-       string code = (c == "C") ? "en" : c;
        // this loops at most twice
        while (true) {
                if (package().messages_file(code).isReadableFile())