THe following patch moves a Qt workaround where it belongs, and solves a weird error message spotted by Vincent.

Vincent, can this go in?

JMarc

>From 72f7b30f365b1dfe18f36d4a9240320a452c4333 Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date: Mon, 3 Jun 2013 18:08:53 +0200
Subject: [PATCH] Move a Qt workaround in the Qt frontend.

---
 src/frontends/qt4/GuiApplication.cpp |    4 +++-
 src/support/Messages.cpp             |    4 +---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp
index 19e9b2b..53fb170 100644
--- a/src/frontends/qt4/GuiApplication.cpp
+++ b/src/frontends/qt4/GuiApplication.cpp
@@ -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");
 }
diff --git a/src/support/Messages.cpp b/src/support/Messages.cpp
index 4eeea5f..906ec3b 100644
--- a/src/support/Messages.cpp
+++ b/src/support/Messages.cpp
@@ -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())
-- 
1.7.0.4

Reply via email to