]> git.lyx.org Git - lyx.git/blobdiff - src/gettext.C
cleanup after svn hang-up, #undef CursorShape. Should be compilable ganin now.
[lyx.git] / src / gettext.C
index a27c579b421797b2421b2814915819c32bf54bec..6c79a241d184d72990d9e3aba9e76f102a8fc2da 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * \file gettext.C
+ * \file src/gettext.C
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
 
 #include <config.h>
 
+#include "gettext.h"
 #include "messages.h"
-#include "LString.h"
-#include "support/LAssert.h"
-
-#include <boost/scoped_ptr.hpp>
+#include "support/environment.h"
+#include "support/docstring.h"
 
 #ifdef HAVE_LOCALE_H
 #  include <locale.h>
 #endif
 
+using lyx::support::setEnv;
+using lyx::docstring;
+
+using std::string;
+
+
 namespace {
 
 Messages & getLyXMessages()
@@ -33,16 +38,24 @@ Messages & getLyXMessages()
 } // anon namespace
 
 
-string const _(string const & str)
+docstring const _(string const & str)
 {
        return getLyXMessages().get(str);
 }
 
 
+docstring const _(docstring const & str)
+{
+       return getLyXMessages().get(lyx::to_utf8(str));
+}
+
+
 #ifdef ENABLE_NLS
 
 void locale_init()
 {
+       // Disable, as otherwise it overrides everything else incl. the doc language
+       setEnv("LANGUAGE", "");
 #  ifdef HAVE_LC_MESSAGES
        setlocale(LC_MESSAGES, "");
 #  endif