From d592ec06b91a6bdb6ddf6687c3762d8edf20fa7d Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 15 Apr 2015 15:27:05 +0200 Subject: [PATCH] Avoid requiring messages with empty language. This is a follow-up to commit 8aa2d6b1. --- src/frontends/qt4/GuiApplication.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index ee2ecbcb8b..94c63461c1 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -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"); }