Am 03.09.2011 um 16:18 schrieb Richard Heck: > On 09/03/2011 09:36 AM, Stephan Witt wrote: >> Am 02.09.2011 um 18:34 schrieb Vincent van Ravesteijn: >> >>> I've been fiddling around endlessly to get the Application menu >>> translated.. without succces.. Unfortunately LyX has the same problem. >>> >>> Are you aware that the documentation is not localized for LyX ? Was there a >>> reason for or did you not came to it yet ? >> The relevant code to choose the correct online help file is in >> i18nLibFileSearch. >> I've armed it with debug - both for 1.6.10 and 2.0.1 - like below: >> >> --- lyx-2.0.1/src/support/filetools.cpp 2011-08-28 20:44:53.000000000 >> +0200 >> +++ lyx-2.0.1-locale/src/support/filetools.cpp 2011-09-03 >> 13:16:00.000000000 +0200 >> @@ -273,6 +273,7 @@ >> >> string lang = to_ascii(_(languageTestString())); >> string const language = getEnv("LANGUAGE"); >> + LYXERR(Debug::LOCALE, "i18nLibFileSearch: lang = " << lang); >> if (!lang.empty() && !language.empty()) >> lang = language; >> >> >> The output is very different! >> >> % locale >> LANG="de_DE.UTF-8" >> LC_COLLATE="de_DE.UTF-8" >> LC_CTYPE="de_DE.UTF-8" >> LC_MESSAGES="de_DE.UTF-8" >> LC_MONETARY="de_DE.UTF-8" >> LC_NUMERIC="de_DE.UTF-8" >> LC_TIME="de_DE.UTF-8" >> LC_ALL= >> >> % LyX-1.6.10.app/Contents/MacOS/lyx -dbg locale >> Setting debug level to locale >> Debugging `locale' (Locale/Internationalisation) >> /Users/Shared/LyX/lyx-1.6.10/src/support/filetools.cpp(252): >> i18nLibFileSearch: lang = de >> ... >> >> % LyX-2.0.1.app/Contents/MacOS/lyx -dbg locale >> Festlegen des Test-Levels auf locale >> Testen von `locale' (Spracheinstellungen/Internationalisierung) >> /Users/Shared/LyX/lyx-2.0.1-locale/src/support/Messages.cpp(97): >> language(ignore) >> /Users/Shared/LyX/lyx-2.0.1-locale/src/support/Messages.cpp(150): Setting >> LANGUAGE to ignore >> /Users/Shared/LyX/lyx-2.0.1-locale/src/support/Messages.cpp(160): Setting >> LC_ALL to en_US >> /Users/Shared/LyX/lyx-2.0.1-locale/src/support/Messages.cpp(195): restoring >> LANGUAGE from ignore to >> /Users/Shared/LyX/lyx-2.0.1-locale/src/support/Messages.cpp(199): restoring >> LC_ALL from en_US to >> /Users/Shared/LyX/lyx-2.0.1-locale/src/support/Messages.cpp(97): >> language(latex) >> /Users/Shared/LyX/lyx-2.0.1-locale/src/support/Messages.cpp(150): Setting >> LANGUAGE to latex >> /Users/Shared/LyX/lyx-2.0.1-locale/src/support/Messages.cpp(160): Setting >> LC_ALL to en_US >> /Users/Shared/LyX/lyx-2.0.1-locale/src/support/Messages.cpp(195): restoring >> LANGUAGE from latex to >> /Users/Shared/LyX/lyx-2.0.1-locale/src/support/Messages.cpp(199): restoring >> LC_ALL from en_US to >> ... >> /Users/Shared/LyX/lyx-2.0.1-locale/src/support/Messages.cpp(97): >> language(cy_GB) >> /Users/Shared/LyX/lyx-2.0.1-locale/src/support/Messages.cpp(150): Setting >> LANGUAGE to cy_GB >> /Users/Shared/LyX/lyx-2.0.1-locale/src/support/Messages.cpp(160): Setting >> LC_ALL to en_US >> /Users/Shared/LyX/lyx-2.0.1-locale/src/support/Messages.cpp(195): restoring >> LANGUAGE from cy_GB to >> /Users/Shared/LyX/lyx-2.0.1-locale/src/support/Messages.cpp(199): restoring >> LC_ALL from en_US to >> /Users/Shared/LyX/lyx-2.0.1-locale/src/support/filetools.cpp(276): >> i18nLibFileSearch: lang = en >> ... >> >> Somehow the locale environment is not honored by LyX in i18nLibFileSearch. I >> don't know if this is intended. >> The result is LyX opening the online help files in english. One has to set >> the interface language explicitly >> in the prefs to get the online help in sync with the menu language. >> >> BTW, this is a regression already in LyX-2.0.0... >> > If this is regarded as a regression, then please file a bug for it.
I'll do that. I was not sure if it's a bug - but it looks like. > However, if I'm understanding what is happening, then it seems to me > correct. If the UI language is set to French, then shouldn't the help > files open in French, whatever the language externally? Or does LyX > honor the LANG variable for UI, but not for the docs? This is the problem. The LANG variable is set to "de_DE.UTF-8". Therefor the UI is german. But the docs are in english because of the "i18nLibFileSearch: lang = en" above. LyX 1.6 prints "i18nLibFileSearch: lang = de" in the same environment. I've checked the preferences already, if I set the UI language this is honored. That's why I didn't detect this. The default value for language is empty of course. > Perhaps a look at git log for filetools.cpp would turn something up.... I'm afraid it's a complex interaction of gettext and the use of the Messages class. Stephan