make Latvian and Lithuanian documents also compilable in branch, fixes bug 5323 and 5324

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@26784 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2008-10-06 19:30:07 +00:00
parent e5ab65e8f1
commit 6d8ae76078
3 changed files with 20 additions and 4 deletions

View File

@ -44,9 +44,9 @@ japanese "" "Japanese" false euc-jp ja_JP ""
kazakh kazakh "Kazakh" false pt154 kk_KZ ""
# there is no country code for Korean because ko_KR is the same as ko_KI
korean "" "Korean" false euc-kr ko ""
#lsorbian lsorbian "Lower Sorbian" false iso8859-2 dsb_DE ""
latvian latvian "Latvian" false iso8859-4 lv_LV ""
lithuanian lithuanian "Lithuanian" false iso8859-13 lt_LT ""
latvian latvian "Latvian" false iso8859-13 lv_LV ""
#lsorbian lsorbian "Lower Sorbian" false iso8859-2 dsb_DE ""
icelandic icelandic "Icelandic" false iso8859-15 is_IS ""
magyar magyar "Magyar" false iso8859-2 hu_HU ""
norsk norsk "Norsk" false iso8859-15 nb_NO ""

View File

@ -872,7 +872,14 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
language_options << ',';
language_options << language->babel();
}
if (lyxrc.language_global_options && !language_options.str().empty())
// if Latvian or Lithuanian is used, babel must directly be loaded
// with language options, not in the class options, see
// http://bugzilla.lyx.org/show_bug.cgi?id=5323
size_t latvian = language_options.str().find("latvian");
size_t lithu = language_options.str().find("lithuanian");
// latvian = string::npos when not found
if (lyxrc.language_global_options && !language_options.str().empty()
&& latvian == string::npos && lithu == string::npos)
clsoptions << language_options.str() << ',';
}
@ -1432,7 +1439,14 @@ string const BufferParams::babelCall(string const & lang_opts) const
// other languages are used (lang_opts is then empty)
if (lang_opts.empty())
return string();
if (!lyxrc.language_global_options)
// If Latvian or Lithuanian is used, babel must directly be loaded with
// the language options, see
// http://bugzilla.lyx.org/show_bug.cgi?id=5323
size_t latvian = lang_opts.find("latvian");
size_t lithu = lang_opts.find("lithuanian");
// latvian = string::npos when not found
if (!lyxrc.language_global_options
|| latvian != string::npos || lithu != string::npos)
return "\\usepackage[" + lang_opts + "]{babel}";
return lang_pack;
}

View File

@ -116,6 +116,8 @@ What's new
- Fix that chess games like the chessgame.lyx example file were not compilable
(bug 5320).
- Latvian and Lithuanian documents are now compilable (bug 5323, bug 5324).
* USER INTERFACE