mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 11:16:55 +00:00
Sort secondary babel languages alphabetically
This commit is contained in:
parent
be4f5c8084
commit
c3cac2048b
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user