X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fgettext.C;h=506178db8ca419480b8af0cf110d98705f0e0b1e;hb=cb52251ccff29d6cbfa13ab90a96be566e3f41ac;hp=08a948e8f40d07dc416317f21ea084b9e41d1093;hpb=7d09a8c0e72b879c36587a884fd404f31234ba18;p=lyx.git diff --git a/src/gettext.C b/src/gettext.C index 08a948e8f4..506178db8c 100644 --- a/src/gettext.C +++ b/src/gettext.C @@ -1,4 +1,3 @@ -// -*- C++ -*- /* This file is part of * ====================================================== * @@ -11,15 +10,16 @@ #include -#ifdef ENABLE_NLS +#ifdef HAVE_LOCALE_H +# include +#endif #include "LString.h" +#ifdef ENABLE_NLS + # if HAVE_GETTEXT # include // use the header already in the system *EK* -# ifdef HAVE_LOCALE_H -# include // for LC_MESSAGES -# endif # else # include "../intl/libintl.h" # endif @@ -43,21 +43,21 @@ string const _(string const & str) char * tmp = new char[s + 1]; str.copy(tmp, s); tmp[s] = '\0'; - string ret(gettext(tmp)); + string const ret(gettext(tmp)); delete [] tmp; return ret; - } - else + } else { return string(); + } } void locale_init() { # ifdef HAVE_LC_MESSAGES setlocale(LC_MESSAGES, ""); +# endif setlocale(LC_CTYPE, ""); setlocale(LC_NUMERIC, "C"); -# endif } void gettext_init(string const & localedir) @@ -67,4 +67,14 @@ void gettext_init(string const & localedir) } +#else // ENABLE_NLS + +void locale_init() +{ + setlocale(LC_NUMERIC, "C"); +} + +void gettext_init(string const &) +{ +} #endif