X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLanguage.cpp;h=e588218047aea9c790753aa0d94b1a118188bd99;hb=1e190a2af27ca99831f51567c16e6b39bf4317c3;hp=e13e3dc36091abab5807ff17a70bc59c4774079d;hpb=cc5dd37a2a051778429836331206b5c7800dee16;p=lyx.git diff --git a/src/Language.cpp b/src/Language.cpp index e13e3dc360..e588218047 100644 --- a/src/Language.cpp +++ b/src/Language.cpp @@ -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; }