* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
#include "lyxrc.h"
#include "language.h"
-extern LyXRC * lyxrc;
+using std::ostream;
+using std::endl;
BufferParams::BufferParams()
{
secnumdepth = 3;
tocdepth = 3;
language = "default";
+ language_info = default_language;
fonts = "default";
inputenc = "latin1";
graphicsDriver = "default";
if (!lex.next()) return;
string tmptok = lex.GetString();
-#if 0
- string test;
- int n = 0;
-#endif
+
// check if tmptok is part of tex_babel in tex-defs.h
Languages::iterator lit = languages.find(tmptok);
if (lit != languages.end()) {
// found it
language = tmptok;
- return;
- }
- // not found
- lyxerr << "Warning: language `"
- << tmptok << "' not recognized!\n"
- << " Setting language to `default'."
- << endl;
- language = "default";
-
-#if 0
- while (true) {
- test = tex_babel[n++];
-
- if (test == tmptok) {
- language = tmptok;
- break;
- }
- else if (test.empty()) {
+ language_info = &(*lit).second;
+ } else {
+ // not found
+ language = "default";
+ language_info = default_language;
+ if (tmptok != "default") {
lyxerr << "Warning: language `"
<< tmptok << "' not recognized!\n"
<< " Setting language to `default'."
<< endl;
- language = "default";
- break;
- }
+ }
}
-#endif
}
}
}
}
-
-
-LyXDirection BufferParams::getDocumentDirection() const
-{
- return (lyxrc->rtl_support &&
- (language == "hebrew" || language == "arabic"))
- ? LYX_DIR_RIGHT_TO_LEFT : LYX_DIR_LEFT_TO_RIGHT;
-}