3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Angus Leeming
8 * Full author contact details are available in file CREDITS.
14 #include "frnt_lang.h"
31 : public std::binary_function<LanguagePair,
34 bool operator()(LanguagePair const & lhs,
35 LanguagePair const & rhs) const {
36 return lhs.first < rhs.first;
43 vector<LanguagePair> const getLanguageData(bool character_dlg)
45 vector<LanguagePair>::size_type const size = character_dlg ?
46 languages.size() + 2 : languages.size();
48 vector<LanguagePair> langs(size);
51 langs[0].first = _("No change");
52 langs[0].second = "ignore";
53 langs[1].first = _("Reset");
54 langs[1].second = "reset";
57 vector<string>::size_type i = character_dlg ? 2 : 0;
58 for (Languages::const_iterator cit = languages.begin();
59 cit != languages.end(); ++cit) {
60 langs[i].first = _(cit->second.display());
61 langs[i].second = cit->second.lang();
65 // Don't sort "ignore" and "reset"
66 vector<LanguagePair>::iterator begin = character_dlg ?
67 langs.begin() + 2 : langs.begin();
69 std::sort(begin, langs.end(), Sorter());
74 } // namespace frontend