mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-08 10:51:03 +00:00
Avoid requiring messages with empty language.
This is a follow-up to commit 8aa2d6b1
.
This commit is contained in:
parent
68ad0bfb90
commit
d592ec06b9
@ -200,15 +200,13 @@ void setLocale()
|
|||||||
if (lyxrc.gui_language == "auto") {
|
if (lyxrc.gui_language == "auto") {
|
||||||
theLocale = QLocale::system();
|
theLocale = QLocale::system();
|
||||||
code = fromqstr(theLocale.name());
|
code = fromqstr(theLocale.name());
|
||||||
// Qt tries to outsmart us and transforms en_US to C.
|
|
||||||
if (code == "C")
|
|
||||||
code = "en_US";
|
|
||||||
} else {
|
} else {
|
||||||
Language const * l = languages.getLanguage(lyxrc.gui_language);
|
Language const * l = languages.getLanguage(lyxrc.gui_language);
|
||||||
code = l ? l->code() : string();
|
code = l ? l->code() : "C";
|
||||||
theLocale = QLocale(toqstr(code));
|
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);
|
QLocale::setDefault(theLocale);
|
||||||
setlocale(LC_NUMERIC, "C");
|
setlocale(LC_NUMERIC, "C");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user