lyxpreamble += "[" + from_ascii(language->polyglossiaOpts()) + "]";
lyxpreamble += "{" + from_ascii(language->polyglossia()) + "}\n";
// now setup the other languages
- std::map<std::string, std::string> const polylangs =
+ set<string> const polylangs =
features.getPolyglossiaLanguages();
- for (std::map<std::string, std::string>::const_iterator mit = polylangs.begin();
+ for (set<string>::const_iterator mit = polylangs.begin();
mit != polylangs.end() ; ++mit) {
+ // We do not output the options here; they are output in
+ // the language switch commands. This is safer if multiple
+ // varieties are used.
+ if (*mit == language->polyglossia())
+ continue;
lyxpreamble += "\\setotherlanguage";
- if (!mit->second.empty())
- lyxpreamble += "[" + from_ascii(mit->second) + "]";
- lyxpreamble += "{" + from_ascii(mit->first) + "}\n";
+ lyxpreamble += "{" + from_ascii(*mit) + "}\n";
}
}