X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fgettext.C;h=925e433363d50ab80972a4c4c70d3f5df129db64;hb=35204f8f33d7400a5fefeffea533fb4cb4097211;hp=a27c579b421797b2421b2814915819c32bf54bec;hpb=0be0fcfd5907d448cd51addf83ed7032719a0692;p=lyx.git diff --git a/src/gettext.C b/src/gettext.C index a27c579b42..925e433363 100644 --- a/src/gettext.C +++ b/src/gettext.C @@ -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. * @@ -11,19 +11,25 @@ #include +#include "gettext.h" #include "messages.h" -#include "LString.h" -#include "support/LAssert.h" +#include "support/environment.h" -#include + +namespace lyx { #ifdef HAVE_LOCALE_H # include #endif +using support::setEnv; + +using std::string; + + namespace { -Messages & getLyXMessages() +static Messages & getLyXMessages() { static Messages lyx_messages; @@ -33,7 +39,7 @@ Messages & getLyXMessages() } // anon namespace -string const _(string const & str) +docstring const _(string const & str) { return getLyXMessages().get(str); } @@ -43,6 +49,8 @@ string const _(string const & str) void locale_init() { + // Disable, as otherwise it overrides everything else incl. the doc language + setEnv("LANGUAGE", ""); # ifdef HAVE_LC_MESSAGES setlocale(LC_MESSAGES, ""); # endif @@ -58,3 +66,6 @@ void locale_init() } #endif + + +} // namespace lyx