mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 10:58:52 +00:00
"AsBabelOptions" no longer required. Part2.
AsBabelOptions was introduced 2010 in [cc5dd37a2a05/lyxgit]. Since the re-orgianization and opening of the Babel package to "contributed" language definitions in March 2013, it is no longer required. Clean up after Part 1 [1361f1a45f23/lyxgit].
This commit is contained in:
parent
d5567ac36f
commit
c349472d35
@ -17,7 +17,6 @@
|
|||||||
# FontEncoding <font encoding|font encoding|...>
|
# FontEncoding <font encoding|font encoding|...>
|
||||||
# InternalEncoding <true|false>
|
# InternalEncoding <true|false>
|
||||||
# RTL <true|false>
|
# RTL <true|false>
|
||||||
# AsBabelOptions <true|false>
|
|
||||||
# LangCode <language_code>
|
# LangCode <language_code>
|
||||||
# LangVariety <language_variety>
|
# LangVariety <language_variety>
|
||||||
# PreBabelPreamble
|
# PreBabelPreamble
|
||||||
@ -101,11 +100,6 @@
|
|||||||
# If True, LyX takes care for characters/macros that do not exist in
|
# If True, LyX takes care for characters/macros that do not exist in
|
||||||
# some font encodings ("<", ">", "|" and straight quote).
|
# some font encodings ("<", ">", "|" and straight quote).
|
||||||
# It is not required for standard encodings like T2A. See bug #5091.
|
# It is not required for standard encodings like T2A. See bug #5091.
|
||||||
# * AsBabelOptions advices LyX to pass the languages locally to babel, not
|
|
||||||
# globally to the class. In the old days, some languages (basically those
|
|
||||||
# not natively supported by babel) needed this.
|
|
||||||
# FIXME: in this case, we might still need to pass the other languages
|
|
||||||
# globally, for the use of other packages (such as varioref).
|
|
||||||
# * LangCode is also used for spellchecking and thesaurus, where the
|
# * LangCode is also used for spellchecking and thesaurus, where the
|
||||||
# dictionaries are named accordingly. Thus, check this when introducing/
|
# dictionaries are named accordingly. Thus, check this when introducing/
|
||||||
# changing language codes (especially aspell, thesaurus).
|
# changing language codes (especially aspell, thesaurus).
|
||||||
@ -781,10 +775,14 @@ Language hebrew
|
|||||||
QuoteStyle english
|
QuoteStyle english
|
||||||
InternalEncoding true
|
InternalEncoding true
|
||||||
# babel-hebrew expects the encoding for *other* languages last:
|
# babel-hebrew expects the encoding for *other* languages last:
|
||||||
# FontEncoding HE8
|
# FontEncoding HE8|LHE
|
||||||
# Define the font encoding the babel-hebrew way and
|
## Use font encoding HE8 if the Culmus fonts are installed and
|
||||||
# work around too simple test for article-like classes in rlbabel.def.
|
# work around too simple test for article-like classes in rlbabel.def.
|
||||||
PreBabelPreamble
|
PreBabelPreamble
|
||||||
|
%\IfFileExists{he8david.fd}{%
|
||||||
|
% \providecommand{\HeblatexEncoding}{HE8}
|
||||||
|
% \providecommand{\HeblatexEncodingFile}{he8enc}%
|
||||||
|
%}{}
|
||||||
\providecommand{\l@chapter}{\relax}
|
\providecommand{\l@chapter}{\relax}
|
||||||
EndPreBabelPreamble
|
EndPreBabelPreamble
|
||||||
DateFormats "d MMMM yyyy|d MMM yyyy|dd/MM/yyyy"
|
DateFormats "d MMMM yyyy|d MMM yyyy|dd/MM/yyyy"
|
||||||
|
@ -1719,8 +1719,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
|
|||||||
language_options << ',';
|
language_options << ',';
|
||||||
language_options << language->babel();
|
language_options << language->babel();
|
||||||
}
|
}
|
||||||
if (global && !features.needBabelLangOptions()
|
if (global && !language_options.str().empty())
|
||||||
&& !language_options.str().empty())
|
|
||||||
clsoptions << language_options.str() << ',';
|
clsoptions << language_options.str() << ',';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1802,8 +1801,8 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
|
|||||||
if (features.mustProvide("pmboxdraw"))
|
if (features.mustProvide("pmboxdraw"))
|
||||||
os << "\\usepackage{pmboxdraw}\n";
|
os << "\\usepackage{pmboxdraw}\n";
|
||||||
|
|
||||||
// FIXME: With Thai as document or secondary language, we must load babel
|
// FIXME: In any document containing text in Thai language,
|
||||||
// before inputenc (see lib/languages).
|
// we must load babel before inputenc (see lib/languages).
|
||||||
// handle inputenc etc.
|
// handle inputenc etc.
|
||||||
writeEncodingPreamble(os, features);
|
writeEncodingPreamble(os, features);
|
||||||
|
|
||||||
@ -2090,7 +2089,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
|
|||||||
os << features.getBabelPresettings();
|
os << features.getBabelPresettings();
|
||||||
// FIXME UNICODE
|
// FIXME UNICODE
|
||||||
os << from_utf8(babelCall(language_options.str(),
|
os << from_utf8(babelCall(language_options.str(),
|
||||||
features.needBabelLangOptions())) + '\n';
|
!lyxrc.language_global_options)) + '\n';
|
||||||
os << features.getBabelPostsettings();
|
os << features.getBabelPostsettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2286,7 +2285,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
|
|||||||
os << features.getBabelPresettings();
|
os << features.getBabelPresettings();
|
||||||
// FIXME UNICODE
|
// FIXME UNICODE
|
||||||
os << from_utf8(babelCall(language_options.str(),
|
os << from_utf8(babelCall(language_options.str(),
|
||||||
features.needBabelLangOptions())) + '\n';
|
!lyxrc.language_global_options)) + '\n';
|
||||||
os << features.getBabelPostsettings();
|
os << features.getBabelPostsettings();
|
||||||
}
|
}
|
||||||
if (features.isRequired("bicaption"))
|
if (features.isRequired("bicaption"))
|
||||||
@ -3215,8 +3214,7 @@ string BufferParams::babelCall(string const & lang_opts, bool const langoptions)
|
|||||||
// other languages are used (lang_opts is then empty)
|
// other languages are used (lang_opts is then empty)
|
||||||
if (lang_opts.empty())
|
if (lang_opts.empty())
|
||||||
return string();
|
return string();
|
||||||
// either a specific language (AsBabelOptions setting in
|
// The prefs may require the languages to
|
||||||
// lib/languages) or the prefs require the languages to
|
|
||||||
// be submitted to babel itself (not the class).
|
// be submitted to babel itself (not the class).
|
||||||
if (langoptions)
|
if (langoptions)
|
||||||
return "\\usepackage[" + lang_opts + "]{babel}";
|
return "\\usepackage[" + lang_opts + "]{babel}";
|
||||||
|
@ -1603,21 +1603,6 @@ docstring const LaTeXFeatures::getBabelPostsettings() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LaTeXFeatures::needBabelLangOptions() const
|
|
||||||
{
|
|
||||||
if (!lyxrc.language_global_options || params_.language->asBabelOptions())
|
|
||||||
return true;
|
|
||||||
|
|
||||||
LanguageList::const_iterator it = UsedLanguages_.begin();
|
|
||||||
LanguageList::const_iterator end = UsedLanguages_.end();
|
|
||||||
for (; it != end; ++it)
|
|
||||||
if ((*it)->asBabelOptions())
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
string const LaTeXFeatures::loadAMSPackages() const
|
string const LaTeXFeatures::loadAMSPackages() const
|
||||||
{
|
{
|
||||||
ostringstream tmp;
|
ostringstream tmp;
|
||||||
|
@ -66,8 +66,6 @@ public:
|
|||||||
docstring const getBabelPresettings() const;
|
docstring const getBabelPresettings() const;
|
||||||
/// Extra preamble code after babel is called
|
/// Extra preamble code after babel is called
|
||||||
docstring const getBabelPostsettings() const;
|
docstring const getBabelPostsettings() const;
|
||||||
/// Do we need to pass the languages to babel directly?
|
|
||||||
bool needBabelLangOptions() const;
|
|
||||||
/// Load AMS packages when appropriate
|
/// Load AMS packages when appropriate
|
||||||
std::string const loadAMSPackages() const;
|
std::string const loadAMSPackages() const;
|
||||||
/// The definitions needed by the document's textclass
|
/// The definitions needed by the document's textclass
|
||||||
|
@ -114,8 +114,7 @@ string Language::dateFormat(size_t i) const
|
|||||||
bool Language::readLanguage(Lexer & lex)
|
bool Language::readLanguage(Lexer & lex)
|
||||||
{
|
{
|
||||||
enum LanguageTags {
|
enum LanguageTags {
|
||||||
LA_AS_BABELOPTS = 1,
|
LA_BABELNAME = 1,
|
||||||
LA_BABELNAME,
|
|
||||||
LA_DATEFORMATS,
|
LA_DATEFORMATS,
|
||||||
LA_ENCODING,
|
LA_ENCODING,
|
||||||
LA_END,
|
LA_END,
|
||||||
@ -137,7 +136,6 @@ bool Language::readLanguage(Lexer & lex)
|
|||||||
|
|
||||||
// Keep these sorted alphabetically!
|
// Keep these sorted alphabetically!
|
||||||
LexerKeyword languageTags[] = {
|
LexerKeyword languageTags[] = {
|
||||||
{ "asbabeloptions", LA_AS_BABELOPTS },
|
|
||||||
{ "babelname", LA_BABELNAME },
|
{ "babelname", LA_BABELNAME },
|
||||||
{ "dateformats", LA_DATEFORMATS },
|
{ "dateformats", LA_DATEFORMATS },
|
||||||
{ "encoding", LA_ENCODING },
|
{ "encoding", LA_ENCODING },
|
||||||
@ -181,9 +179,6 @@ bool Language::readLanguage(Lexer & lex)
|
|||||||
case LA_END: // end of structure
|
case LA_END: // end of structure
|
||||||
finished = true;
|
finished = true;
|
||||||
break;
|
break;
|
||||||
case LA_AS_BABELOPTS:
|
|
||||||
lex >> as_babel_options_;
|
|
||||||
break;
|
|
||||||
case LA_BABELNAME:
|
case LA_BABELNAME:
|
||||||
lex >> babel_;
|
lex >> babel_;
|
||||||
break;
|
break;
|
||||||
@ -254,7 +249,6 @@ bool Language::readLanguage(Lexer & lex)
|
|||||||
|
|
||||||
bool Language::read(Lexer & lex)
|
bool Language::read(Lexer & lex)
|
||||||
{
|
{
|
||||||
as_babel_options_ = 0;
|
|
||||||
encoding_ = 0;
|
encoding_ = 0;
|
||||||
internal_enc_ = 0;
|
internal_enc_ = 0;
|
||||||
rightToLeft_ = 0;
|
rightToLeft_ = 0;
|
||||||
|
@ -36,7 +36,7 @@ class Language {
|
|||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
Language() : rightToLeft_(false), encoding_(0), internal_enc_(false),
|
Language() : rightToLeft_(false), encoding_(0), internal_enc_(false),
|
||||||
as_babel_options_(false), has_gui_support_(false) {}
|
has_gui_support_(false) {}
|
||||||
/// LyX language name
|
/// LyX language name
|
||||||
std::string const lang() const { return lang_; }
|
std::string const lang() const { return lang_; }
|
||||||
/// Babel language name
|
/// Babel language name
|
||||||
@ -88,8 +88,6 @@ public:
|
|||||||
std::string fontenc(BufferParams const &) const;
|
std::string fontenc(BufferParams const &) const;
|
||||||
/// Return the localized date formats (long, medium, short format)
|
/// Return the localized date formats (long, medium, short format)
|
||||||
std::string dateFormat(size_t i) const;
|
std::string dateFormat(size_t i) const;
|
||||||
/// This language needs to be passed to babel itself (not the class)
|
|
||||||
bool asBabelOptions() const { return as_babel_options_; }
|
|
||||||
/// This language corresponds to a translation of the GUI
|
/// This language corresponds to a translation of the GUI
|
||||||
bool hasGuiSupport() const { return has_gui_support_; }
|
bool hasGuiSupport() const { return has_gui_support_; }
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user