From 6a10fbcc39c528b32e816033fcb78d27787c37be Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 31 Oct 2001 12:43:09 +0000 Subject: [PATCH] fix locale problem with --disable-nls git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2952 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 5 +++++ configure.in | 2 +- src/ChangeLog | 5 +++++ src/gettext.C | 10 ++++++---- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 993d14abcf..0fa1485078 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-10-31 Jean-Marc Lasgouttes + + * configure.in: check also for locale.h, so that things work out + correctly with --disable-nls + 2001-10-30 John Levon * README: diff --git a/configure.in b/configure.in index c9c287a0e0..409f089397 100644 --- a/configure.in +++ b/configure.in @@ -262,7 +262,7 @@ AC_LANG_CPLUSPLUS # some standard header files AC_HEADER_DIRENT AC_HEADER_MAJOR -AC_CHECK_HEADERS(sys/time.h sys/types.h sys/select.h strings.h) +AC_CHECK_HEADERS(sys/time.h sys/types.h sys/select.h strings.h locale.h) # some annoying header files #LYX_PATH_HEADER(stl_string_fwd.h) diff --git a/src/ChangeLog b/src/ChangeLog index 794672ec19..5a603c4403 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-10-31 Jean-Marc Lasgouttes + + * gettext.C (locale_init): set LC_NUMERIC to "C" even if nls is + disabled. + 2001-10-30 John Levon * lyx_main.C: change ref to known bugs diff --git a/src/gettext.C b/src/gettext.C index 77b1a67275..b80792ac22 100644 --- a/src/gettext.C +++ b/src/gettext.C @@ -10,15 +10,16 @@ #include +#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 @@ -54,9 +55,9 @@ 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) @@ -74,5 +75,6 @@ void locale_init() void gettext_init(string const &) { + setlocale(LC_NUMERIC, "C"); } #endif -- 2.39.2