]> git.lyx.org Git - lyx.git/blobdiff - src/language.C
Partly fix for bug 1231
[lyx.git] / src / language.C
index 55c89e8ca7c8fbcf510cd687caccbdc4a883c7eb..c811aac9a9c5bfe41897eb6425d4f1ec54c4f079 100644 (file)
@@ -1,27 +1,27 @@
-/* This file is part of
- * ====================================================== 
- * 
- *           LyX, The Document Processor
- *        
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2001 The LyX Team.
+/**
+ * \file language.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * ====================================================== */
+ * \author Lars Gullik Bjønnes
+ * \author Jean-Marc Lasgouttes
+ * \author Dekel Tsur
+ *
+ * Full author contact details are available in file CREDITS.
+ */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "language.h"
-#include "gettext.h"
+
+#include "debug.h"
 #include "encoding.h"
-#include "lyxrc.h"
 #include "lyxlex.h"
-#include "debug.h"
+#include "lyxrc.h"
 
 using std::endl;
+using std::string;
+
 
 Languages languages;
 Language const * english_language;
@@ -30,22 +30,14 @@ Language ignore_lang("ignore", "ignore", "Ignore", false, 0, "ignore", "");
 Language const * ignore_language = &ignore_lang;
 Language latex_lang("latex", "latex", "Latex", false, 0, "latex", "");
 Language const * latex_language = &latex_lang;
-#ifdef INHERIT_LANG
-Language inherit_lang("inherit", "inherit", "Inherit", false, 0, "inherit", "");
-Language const * inherit_language = &inherit_lang;
-#endif
-
-void Languages::setDefaults()
-{
-       languagelist["english"] = Language("english", "english", N_("English"),
-                                          false, 
-                                          encodings.getEncoding("iso8859-1"),
-                                          "en", "");
-       english_language = default_language = &languagelist["english"];
-}
 
 void Languages::read(string const & filename)
 {
+       // We need to set the encoding of latex_lang
+       latex_lang = Language("latex", "latex", "Latex", false,
+                             encodings.getEncoding("iso8859-1"),
+                             "latex", "");
+
        LyXLex lex(0, 0);
        lex.setFile(filename);
        while (lex.isOK()) {
@@ -79,10 +71,10 @@ void Languages::read(string const & filename)
                Encoding const * encoding = encodings.getEncoding(encoding_str);
                if (!encoding) {
                        encoding = encodings.getEncoding("iso8859-1");
-                       lyxerr << "Unknown encoding " << encoding_str << endl; 
+                       lyxerr << "Unknown encoding " << encoding_str << endl;
                }
 
-               languagelist[lang] = Language(lang, babel, display, rtl, 
+               languagelist[lang] = Language(lang, babel, display, rtl,
                                              encoding, code, latex_options);
        }
 
@@ -103,7 +95,7 @@ void Languages::read(string const & filename)
 
 Language const * Languages::getLanguage(string const & language) const
 {
-               const_iterator it = languagelist.find(language);
+       const_iterator it = languagelist.find(language);
        if (it != languagelist.end())
                return &it->second;
        else