Language const * reset_language = 0;
+bool Language::isPolyglossiaExclusive() const
+{
+ return babel().empty() && !polyglossia().empty() && requires().empty();
+}
+
+
docstring const Language::translateLayout(string const & m) const
{
if (m.empty())
}
// Read layout translations
- FileName path = libFileSearch(string(), "layouttranslations");
+ FileName const path = libFileSearch(string(), "layouttranslations");
readLayoutTranslations(path);
-
- // Read installed translations
- path = libFileSearch(string(), "installed_translations");
- readInstalledTranslations(path);
}
}
-void Languages::readInstalledTranslations(support::FileName const & filename)
-{
- Lexer lex;
- lex.setFile(filename);
- lex.setContext("Languages::read");
-
- // 1) read all installed gmo files names
- set<string> installed_translations;
- string lang_code;
- while (lex.isOK()) {
- lex >> lang_code;
- installed_translations.insert(lang_code);
- }
-
- // 2) mark all corresponding languages as translated.
- LanguageList::iterator lit = languagelist.begin();
- LanguageList::iterator const lend = languagelist.end();
- for ( ; lit != lend ; ++lit) {
- if (installed_translations.count(lit->second.code())
- || installed_translations.count(token(lit->second.code(), '_', 0)))
- lit->second.translated(true);
- }
-
-}
-
-
Language const * Languages::getLanguage(string const & language) const
{
if (language == "reset")