]> 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 fe9d56d00a7c3f5c3ececb7fc23b804606f77540..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;
@@ -165,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;
 }