void setLocale()
{
QLocale theLocale;
+ string code;
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);
- string const code = l ? l->code() : string();
+ code = l ? l->code() : string();
theLocale = QLocale(toqstr(code));
}
- string const code = fromqstr(theLocale.name());
- // Qt tries to outsmart us and transforms en_US to C.
- Messages::guiLanguage((code == "C") ? "en_US" : code);
+ Messages::guiLanguage(code);
QLocale::setDefault(theLocale);
setlocale(LC_NUMERIC, "C");
}