mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
some less language hardcoding
This commit is contained in:
parent
f84c8c56f5
commit
f71a55a279
@ -21,6 +21,7 @@
|
||||
# PostBabelPreamble
|
||||
# <extra latex code inserted after babel>
|
||||
# EndPostBabelPreamble
|
||||
# Requires <requirement>
|
||||
# End
|
||||
#
|
||||
#
|
||||
@ -261,6 +262,7 @@ Language chinese-simplified
|
||||
GuiName "Chinese (simplified)"
|
||||
Encoding euc-cn
|
||||
LangCode zh_CN
|
||||
Requires CJK
|
||||
End
|
||||
|
||||
# uses CJK package
|
||||
@ -268,6 +270,7 @@ Language chinese-traditional
|
||||
GuiName "Chinese (traditional)"
|
||||
Encoding utf8-cjk
|
||||
LangCode zh_CN
|
||||
Requires CJK
|
||||
End
|
||||
|
||||
# not supported by babel
|
||||
@ -513,6 +516,7 @@ Language japanese
|
||||
Encoding jis-plain
|
||||
LangCode ja_JP
|
||||
AsBabelOptions true
|
||||
Requires japanese
|
||||
End
|
||||
|
||||
# uses CJK package
|
||||
@ -520,6 +524,7 @@ Language japanese-cjk
|
||||
GuiName "Japanese (CJK)"
|
||||
Encoding euc-jp
|
||||
LangCode ja_JP
|
||||
Requires CJK
|
||||
End
|
||||
|
||||
# not yet supported by polyglossia
|
||||
@ -534,6 +539,7 @@ Language korean
|
||||
GuiName "Korean"
|
||||
Encoding euc-kr
|
||||
LangCode ko_KR
|
||||
Requires CJK
|
||||
End
|
||||
|
||||
# not supported by babel
|
||||
@ -873,6 +879,7 @@ Language vietnamese
|
||||
Encoding utf8
|
||||
LangCode vi_VN
|
||||
AsBabelOptions true
|
||||
Requires vietnamese
|
||||
End
|
||||
|
||||
Language welsh
|
||||
|
@ -1250,10 +1250,8 @@ void BufferParams::validate(LaTeXFeatures & features) const
|
||||
|| useNonTeXFonts))
|
||||
features.require("polyglossia");
|
||||
|
||||
if (language->lang() == "vietnamese")
|
||||
features.require("vietnamese");
|
||||
else if (language->lang() == "japanese")
|
||||
features.require("japanese");
|
||||
if (!language->requires().empty())
|
||||
features.require(language->requires());
|
||||
}
|
||||
|
||||
|
||||
@ -2688,9 +2686,6 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
|
||||
// If the "japanese" package (i.e. pLaTeX) is used,
|
||||
// inputenc must be omitted.
|
||||
// see http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg129680.html
|
||||
if (package == Encoding::japanese)
|
||||
features.require("japanese");
|
||||
|
||||
if ((!encodings.empty() || package == Encoding::inputenc)
|
||||
&& !features.isRequired("japanese")) {
|
||||
os << "\\usepackage[";
|
||||
|
@ -453,8 +453,8 @@ void LaTeXFeatures::useLanguage(Language const * lang)
|
||||
{
|
||||
if (!lang->babel().empty())
|
||||
UsedLanguages_.insert(lang);
|
||||
if (lang->lang() == "vietnamese")
|
||||
require("vietnamese");
|
||||
if (!lang->requires().empty())
|
||||
require(lang->requires());
|
||||
// CJK languages do not have a babel name.
|
||||
// They use the CJK package
|
||||
if (lang->encoding()->package() == Encoding::CJK)
|
||||
|
@ -74,6 +74,7 @@ bool Language::readLanguage(Lexer & lex)
|
||||
LA_POLYGLOSSIAOPTS,
|
||||
LA_POSTBABELPREAMBLE,
|
||||
LA_PREBABELPREAMBLE,
|
||||
LA_REQUIRES,
|
||||
LA_RTL
|
||||
};
|
||||
|
||||
@ -91,6 +92,7 @@ bool Language::readLanguage(Lexer & lex)
|
||||
{ "polyglossiaopts", LA_POLYGLOSSIAOPTS },
|
||||
{ "postbabelpreamble", LA_POSTBABELPREAMBLE },
|
||||
{ "prebabelpreamble", LA_PREBABELPREAMBLE },
|
||||
{ "requires", LA_REQUIRES },
|
||||
{ "rtl", LA_RTL }
|
||||
};
|
||||
|
||||
@ -152,6 +154,9 @@ bool Language::readLanguage(Lexer & lex)
|
||||
babel_presettings_ =
|
||||
lex.getLongString("EndPreBabelPreamble");
|
||||
break;
|
||||
case LA_REQUIRES:
|
||||
lex >> requires_;
|
||||
break;
|
||||
case LA_RTL:
|
||||
lex >> rightToLeft_;
|
||||
break;
|
||||
|
@ -40,6 +40,8 @@ public:
|
||||
std::string const & polyglossia() const { return polyglossia_name_; }
|
||||
/// polyglossia language options
|
||||
std::string const & polyglossiaOpts() const { return polyglossia_opts_; }
|
||||
/// requirement (package, function)
|
||||
std::string const & requires() const { return requires_; }
|
||||
/// translatable GUI name
|
||||
std::string const & display() const { return display_; }
|
||||
/// is this a RTL language?
|
||||
@ -93,6 +95,8 @@ private:
|
||||
///
|
||||
std::string polyglossia_opts_;
|
||||
///
|
||||
std::string requires_;
|
||||
///
|
||||
std::string display_;
|
||||
///
|
||||
bool rightToLeft_;
|
||||
|
Loading…
Reference in New Issue
Block a user