X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLanguage.cpp;h=1ff2cf71892a8e010177c0c33b757495c5be6559;hb=77713af55868140483a1a7f5704dd93b97dbe116;hp=ae9de0d63f4d2fbf644516250aae0a5cba0ab9b2;hpb=f7feff9fb34928d2b3d16984527bd1f6fe7f9343;p=lyx.git diff --git a/src/Language.cpp b/src/Language.cpp index ae9de0d63f..1ff2cf7189 100644 --- a/src/Language.cpp +++ b/src/Language.cpp @@ -3,7 +3,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Lars Gullik Bjønnes + * \author Lars Gullik Bjønnes * \author Jean-Marc Lasgouttes * \author Dekel Tsur * @@ -20,6 +20,7 @@ #include "support/debug.h" #include "support/FileName.h" +#include "support/lstrings.h" using namespace std; using namespace lyx::support; @@ -33,6 +34,7 @@ Language latex_lang; Language const * default_language; Language const * ignore_language = &ignore_lang; Language const * latex_language = &latex_lang; +Language const * reset_language = 0; bool Language::read(Lexer & lex) @@ -43,11 +45,13 @@ bool Language::read(Lexer & lex) lex >> display_; lex >> rightToLeft_; lex >> encodingStr_; - lex >> code_; + lex >> codeStr_; lex >> latex_options_; if (!lex) return false; + variety_ = split(codeStr_, code_, '-'); + encoding_ = encodings.fromLyXName(encodingStr_); if (!encoding_ && !encodingStr_.empty()) { encoding_ = encodings.fromLyXName("iso8859-1"); @@ -56,6 +60,16 @@ bool Language::read(Lexer & lex) return true; } +bool Language::internalFontEncoding() const +{ + // FIXME: list incomplete + // FIXME: instead of hardcoding, this + // should go to the languages file + return lang_ == "hebrew" + || lang_ == "greek" + || lang_ == "polutonikogreek"; +} + void Languages::read(FileName const & filename) { @@ -90,8 +104,12 @@ void Languages::read(FileName const & filename) Language const * Languages::getLanguage(string const & language) const { + if (language == "reset") + return reset_language; + if (language == "ignore") + return ignore_language; const_iterator it = languagelist.find(language); - return it == languagelist.end() ? 0 : &it->second; + return it == languagelist.end() ? reset_language : &it->second; }