+ docstring t = from_ascii(msg);
+ cleanTranslation(t);
+ return t;
+}
+
+
+string Language::fontenc(BufferParams const & params) const
+{
+ // Don't use LaTeX fonts, so just return the language's preferred
+ // (although this is not used with nonTeXFonts anyway).
+ if (params.useNonTeXFonts)
+ return fontenc_.front() == "ASCII" ? "T1" : fontenc_.front();
+
+ // Determine optimal font encoding
+ // We check whether the used rm font supports an encoding our language supports
+ LaTeXFont const & lf =
+ theLaTeXFonts().getLaTeXFont(from_ascii(params.fontsRoman()));
+ vector<string> const & lfe = lf.fontencs();
+ for (auto & fe : fontenc_) {
+ // ASCII means: support all T* encodings plus OT1
+ if (fe == "ASCII") {
+ for (auto & afe : lfe) {
+ if (afe == "OT1" || prefixIs(afe, "T"))
+ // we found a suitable one; return that.
+ return afe;
+ }
+ }
+ // For other encodings, just check whether the font supports it
+ if (lf.hasFontenc(fe))
+ return fe;
+ }
+ // We did not find a suitable one; just take the first in the list,
+ // the priorized one (which is "T1" for ASCII).
+ return fontenc_.front() == "ASCII" ? "T1" : fontenc_.front();
+}
+
+
+string Language::dateFormat(size_t i) const
+{
+ if (i > dateformats_.size())
+ return string();
+ return dateformats_.at(i);
+}
+
+
+docstring Language::decimalSeparator() const
+{
+ if (lyxrc.default_decimal_sep == "locale") {
+ QLocale loc = QLocale(toqstr(code()));
+ return qstring_to_ucs4(QString(loc.decimalPoint()));
+ }
+ return from_utf8(lyxrc.default_decimal_sep);