]> git.lyx.org Git - lyx.git/blobdiff - src/language.C
GTK graphics dialog: Default to scaling 100% when no scaling or size is given
[lyx.git] / src / language.C
index 017049fe237a4fea7afee2d85ad43ac20c573c28..34e08854199483f00fa1aa0e91c99b50a7f7eb12 100644 (file)
@@ -1,58 +1,41 @@
-/* This file is part of
- * ======================================================
+/**
+ * \file language.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
+ * \author Lars Gullik Bjønnes
+ * \author Jean-Marc Lasgouttes
+ * \author Dekel Tsur
  *
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2001 The LyX Team.
- *
- * ====================================================== */
+ * 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;
 Language const * default_language;
-Language ignore_lang("ignore", "ignore", "Ignore", false, 0, "ignore", "");
+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 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()
-{
-       // We need to set the encoding of latex_lang
-       latex_lang = Language("latex", "latex", "Latex", false,
-                             encodings.getEncoding("iso8859-1"),
-                             "latex", "");
-
-       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,
+       latex_lang = Language("latex", "latex", "Latex", false, "iso8859-1",
                              encodings.getEncoding("iso8859-1"),
                              "latex", "");
 
@@ -93,7 +76,7 @@ void Languages::read(string const & filename)
                }
 
                languagelist[lang] = Language(lang, babel, display, rtl,
-                                             encoding, code, latex_options);
+                                             encoding_str, encoding, code, latex_options);
        }
 
        default_language = getLanguage(lyxrc.default_language);
@@ -111,11 +94,9 @@ void Languages::read(string const & filename)
                english_language = default_language;
 }
 
+
 Language const * Languages::getLanguage(string const & language) const
 {
        const_iterator it = languagelist.find(language);
-       if (it != languagelist.end())
-               return &it->second;
-       else
-               return 0;
+       return it == languagelist.end() ? 0 : &it->second;
 }