support fully the LANGUAGE variable

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8826 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2004-06-29 12:55:09 +00:00
parent 3c102d9778
commit 228ecfce96
2 changed files with 14 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2004-06-29 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* filetools.C (i18nLibFileSearch): honor case where LANGUAGE
specifies a list of locales (thanks to Pablo Saraxtaga for the
initial patch).
2004-05-04 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* path_defines.C.in (setLyxPaths): make sure that LyX/Mac can find

View File

@ -332,18 +332,18 @@ i18nLibFileSearch(string const & dir, string const & name,
if (lang != "C" && lang != "POSIX" && !language.empty())
lang = language;
lang = token(lang, '_', 0);
if (lang.empty() || lang == "C")
return LibFileSearch(dir, name, ext);
else {
string const tmp = LibFileSearch(dir, lang + '_' + name,
string l;
lang = split(lang, l, ':');
while (!l.empty() && l != "C" && l != "POSIX") {
string const tmp = LibFileSearch(dir,
token(l, '_', 0) + '_' + name,
ext);
if (!tmp.empty())
return tmp;
else
return LibFileSearch(dir, name, ext);
lang = split(lang, l, ':');
}
return LibFileSearch(dir, name, ext);
}