Sort secondary babel languages alphabetically

This commit is contained in:
Juergen Spitzmueller 2020-08-23 10:04:07 +02:00
parent be4f5c8084
commit c3cac2048b

View File

@ -990,22 +990,19 @@ vector<string> LaTeXFeatures::getBabelExclusiveLanguages() const
string LaTeXFeatures::getBabelLanguages() const
{
ostringstream langs;
bool first = true;
LanguageList::const_iterator const begin = UsedLanguages_.begin();
for (LanguageList::const_iterator cit = begin;
cit != UsedLanguages_.end();
++cit) {
if ((*cit)->babel().empty())
continue;
if (!first)
langs << ',';
else
first = false;
langs << (*cit)->babel();
vector<string> blangs;
for (auto const & lang : UsedLanguages_) {
if (!lang->babel().empty())
blangs.push_back(lang->babel());
}
return langs.str();
// Sort alphabetically to assure consistent order
// (the order itself does not matter apart from
// some exceptions, e.g. hebrew must come after
// arabic and farsi)
sort(blangs.begin(), blangs.end());
return getStringFromVector(blangs);
}