3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
9 * Full author contact details are available in file CREDITS.
17 #include "support/environment.h"
18 #include "support/lstrings.h"
27 using support::setEnv;
34 static Messages & getLyXMessages()
36 static Messages lyx_messages;
44 docstring const _(string const & str)
46 return getLyXMessages().get(str);
54 // Disable, as otherwise it overrides everything else incl. the doc language
55 setEnv("LANGUAGE", "");
56 # ifdef HAVE_LC_MESSAGES
57 setlocale(LC_MESSAGES, "");
59 setlocale(LC_CTYPE, "");
60 setlocale(LC_NUMERIC, "C");
67 setlocale(LC_NUMERIC, "C");
73 docstring const translateIfPossible(docstring const & name)
75 if (support::isAscii(name))
76 // Probably from a standard configuration file, try to
78 return _(to_ascii(name));
80 // This must be from a user defined configuration file. We
81 // cannot translate this, since gettext accepts only ascii