mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 10:18:50 +00:00
GUI language via RC: some bug corrections.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25386 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
39393bf788
commit
1c83bf9420
11
src/LyX.cpp
11
src/LyX.cpp
@ -345,8 +345,15 @@ Messages & LyX::getGuiMessages()
|
||||
|
||||
void LyX::setRcGuiLanguage()
|
||||
{
|
||||
if (lyxrc.gui_language != "auto")
|
||||
pimpl_->messages_["GUI"] = Messages(lyxrc.gui_language);
|
||||
if (lyxrc.gui_language == "auto")
|
||||
return;
|
||||
LYXERR(Debug::LOCALE, "Setting LANGUAGE to " << lyxrc.gui_language);
|
||||
if (!setEnv("LANGUAGE", lyxrc.gui_language))
|
||||
LYXERR(Debug::LOCALE, "\t... failed!");
|
||||
LYXERR(Debug::LOCALE, "Setting LC_ALL to en_US");
|
||||
if (!setEnv("LC_ALL", "en_US"))
|
||||
LYXERR(Debug::LOCALE, "\t... failed!");
|
||||
pimpl_->messages_["GUI"] = Messages();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1023,6 +1023,9 @@ void GuiApplication::exit(int status)
|
||||
|
||||
void GuiApplication::execBatchCommands()
|
||||
{
|
||||
// Set the language defined by the user.
|
||||
LyX::ref().setRcGuiLanguage();
|
||||
|
||||
// Read menus
|
||||
if (!readUIFile(toqstr(lyxrc.ui_file)))
|
||||
// Gives some error box here.
|
||||
|
@ -111,8 +111,8 @@ docstring const Messages::get(string const & m) const
|
||||
|
||||
// The string was not found, use gettext to generate it
|
||||
|
||||
static string const oldLANGUAGE = getEnv("LANGUAGE");
|
||||
static string const oldLC_ALL = getEnv("LC_ALL");
|
||||
string const oldLANGUAGE = getEnv("LANGUAGE");
|
||||
string const oldLC_ALL = getEnv("LC_ALL");
|
||||
if (!lang_.empty()) {
|
||||
// This GNU extension overrides any language locale
|
||||
// wrt gettext.
|
||||
|
Loading…
Reference in New Issue
Block a user