#include "gettext.h"
#include "Messages.h"
-#include "support/environment.h"
#include "support/lstrings.h"
-
-namespace lyx {
-
#ifdef HAVE_LOCALE_H
# include <locale.h>
#endif
-using support::setEnv;
-
using std::string;
+namespace lyx {
+
docstring const _(string const & str)
{
return getGuiMessages().get(str);
}
-#ifdef ENABLE_NLS
-
void locale_init()
{
- // Disable, as otherwise it overrides everything else incl. the doc language
- setEnv("LANGUAGE", "");
+#ifdef ENABLE_NLS
# ifdef HAVE_LC_MESSAGES
setlocale(LC_MESSAGES, "");
# endif
setlocale(LC_CTYPE, "");
+ Messages::init();
+#endif
setlocale(LC_NUMERIC, "C");
}
-#else // ENABLE_NLS
-
-void locale_init()
-{
- setlocale(LC_NUMERIC, "C");
-}
-
-#endif
-
docstring const translateIfPossible(docstring const & name)
{