From 228ecfce96b9623db668bb259afc7485d47f9957 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 29 Jun 2004 12:55:09 +0000 Subject: [PATCH] support fully the LANGUAGE variable git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8826 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/ChangeLog | 6 ++++++ src/support/filetools.C | 16 ++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 727543fae6..27e34e2327 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,9 @@ +2004-06-29 Jean-Marc Lasgouttes + + * 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 * path_defines.C.in (setLyxPaths): make sure that LyX/Mac can find diff --git a/src/support/filetools.C b/src/support/filetools.C index fe020bdac9..4d1cd6c8b2 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -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); } -- 2.39.2