* 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
*
#include "support/debug.h"
#include "support/FileName.h"
+#include "support/lstrings.h"
using namespace std;
using namespace lyx::support;
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)
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");
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)
{
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;
}