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,
35 bool operator()(LanguagePair const & lhs,
36 LanguagePair const & rhs) const {
37 return lhs.first < rhs.first;
44 vector<LanguagePair> const getLanguageData(bool character_dlg)
46 vector<LanguagePair>::size_type const size = character_dlg ?
47 languages.size() + 2 : languages.size();
49 vector<LanguagePair> langs(size);
52 langs[0].first = lyx::to_utf8(_("No change"));
53 langs[0].second = "ignore";
54 langs[1].first = lyx::to_utf8(_("Reset"));
55 langs[1].second = "reset";
58 vector<string>::size_type i = character_dlg ? 2 : 0;
59 for (Languages::const_iterator cit = languages.begin();
60 cit != languages.end(); ++cit) {
61 langs[i].first = lyx::to_utf8(_(cit->second.display()));
62 langs[i].second = cit->second.lang();
66 // Don't sort "ignore" and "reset"
67 vector<LanguagePair>::iterator begin = character_dlg ?
68 langs.begin() + 2 : langs.begin();
70 std::sort(begin, langs.end(), Sorter());
75 } // namespace frontend