]> git.lyx.org Git - lyx.git/blobdiff - src/Language.cpp
use return value of regex_match to check whether a match was found
[lyx.git] / src / Language.cpp
index e13e3dc36091abab5807ff17a70bc59c4774079d..e588218047aea9c790753aa0d94b1a118188bd99 100644 (file)
@@ -22,6 +22,7 @@
 #include "support/debug.h"
 #include "support/FileName.h"
 #include "support/lstrings.h"
+#include "support/Messages.h"
 
 using namespace std;
 using namespace lyx::support;
@@ -49,6 +50,8 @@ bool Language::readLanguage(Lexer & lex)
                LA_INTERNAL_ENC,
                LA_LANG_CODE,
                LA_LANG_VARIETY,
+               LA_POLYGLOSSIANAME,
+               LA_POLYGLOSSIAOPTS,
                LA_POSTBABELPREAMBLE,
                LA_PREBABELPREAMBLE,
                LA_RTL
@@ -64,6 +67,8 @@ bool Language::readLanguage(Lexer & lex)
                { "internalencoding",     LA_INTERNAL_ENC },
                { "langcode",             LA_LANG_CODE },
                { "langvariety",          LA_LANG_VARIETY },
+               { "polyglossianame",      LA_POLYGLOSSIANAME },
+               { "polyglossiaopts",      LA_POLYGLOSSIAOPTS },
                { "postbabelpreamble",    LA_POSTBABELPREAMBLE },
                { "prebabelpreamble",     LA_PREBABELPREAMBLE },
                { "rtl",                  LA_RTL }
@@ -98,6 +103,12 @@ bool Language::readLanguage(Lexer & lex)
                case LA_BABELNAME:
                        lex >> babel_;
                        break;
+               case LA_POLYGLOSSIANAME:
+                       lex >> polyglossia_name_;
+                       break;
+               case LA_POLYGLOSSIAOPTS:
+                       lex >> polyglossia_opts_;
+                       break;
                case LA_ENCODING:
                        lex >> encodingStr_;
                        break;
@@ -155,6 +166,10 @@ bool Language::read(Lexer & lex)
                encoding_ = encodings.fromLyXName("iso8859-1");
                LYXERR0("Unknown encoding " << encodingStr_);
        }
+       // cache translation status. Calling getMessages() directly in
+       // PrefLanguage::PrefLanguage() did only work if the gui language
+       // was set to auto (otherwise all languages would be marked as available).
+       translated_ = getMessages(code()).available();
        return true;
 }