X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLanguage.cpp;h=809e04bcfb8ebe1ec153f8141cfd11560d713da3;hb=037b1e14789223c89e88e8bd74baffa4d0956571;hp=ccac6975690152452f6a674bbb97e2cc16179cd3;hpb=6f8298b1658106c6536a6532af27822e74d41649;p=lyx.git diff --git a/src/Language.cpp b/src/Language.cpp index ccac697569..809e04bcfb 100644 --- a/src/Language.cpp +++ b/src/Language.cpp @@ -25,8 +25,12 @@ #include "support/filetools.h" #include "support/lassert.h" #include "support/lstrings.h" +#include "support/qstring_helpers.h" #include "support/Messages.h" +#include +#include + using namespace std; using namespace lyx::support; @@ -41,13 +45,13 @@ Language const * reset_language = 0; bool Language::isPolyglossiaExclusive() const { - return babel().empty() && !polyglossia().empty() && requires().empty(); + return babel().empty() && !polyglossia().empty() && required().empty(); } bool Language::isBabelExclusive() const { - return !babel().empty() && polyglossia().empty() && requires().empty(); + return !babel().empty() && polyglossia().empty() && required().empty(); } @@ -111,6 +115,16 @@ string Language::dateFormat(size_t i) const } +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); +} + + bool Language::readLanguage(Lexer & lex) { enum LanguageTags { @@ -126,17 +140,20 @@ bool Language::readLanguage(Lexer & lex) LA_LANG_VARIETY, LA_POLYGLOSSIANAME, LA_POLYGLOSSIAOPTS, + LA_XINDYNAME, LA_POSTBABELPREAMBLE, LA_PREBABELPREAMBLE, LA_PROVIDES, LA_REQUIRES, LA_QUOTESTYLE, LA_RTL, - LA_WORDWRAP + LA_WORDWRAP, + LA_ACTIVECHARS }; // Keep these sorted alphabetically! LexerKeyword languageTags[] = { + { "activechars", LA_ACTIVECHARS }, { "babelname", LA_BABELNAME }, { "dateformats", LA_DATEFORMATS }, { "encoding", LA_ENCODING }, @@ -155,7 +172,8 @@ bool Language::readLanguage(Lexer & lex) { "quotestyle", LA_QUOTESTYLE }, { "requires", LA_REQUIRES }, { "rtl", LA_RTL }, - {"wordwrap", LA_WORDWRAP } + { "wordwrap", LA_WORDWRAP }, + { "xindyname", LA_XINDYNAME } }; bool error = false; @@ -190,9 +208,15 @@ bool Language::readLanguage(Lexer & lex) case LA_POLYGLOSSIAOPTS: lex >> polyglossia_opts_; break; + case LA_XINDYNAME: + lex >> xindy_; + break; case LA_QUOTESTYLE: lex >> quote_style_; break; + case LA_ACTIVECHARS: + lex >> active_chars_; + break; case LA_ENCODING: lex >> encodingStr_; break;