2 * \file src/gettext.cpp
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.
14 #include "support/gettext.h"
16 #include "support/lstrings.h"
17 #include "support/Messages.h"
27 docstring const _(string const & str)
29 return getGuiMessages().get(str);
36 # ifdef HAVE_LC_MESSAGES
37 setlocale(LC_MESSAGES, "");
39 setlocale(LC_CTYPE, "");
42 setlocale(LC_NUMERIC, "C");
46 docstring const translateIfPossible(docstring const & name)
48 if (support::isAscii(name))
49 // Probably from a standard configuration file, try to
51 return _(to_ascii(name));
53 // This must be from a user defined configuration file. We
54 // cannot translate this, since gettext accepts only ascii