From: Keith M. <kei...@us...> - 2008-03-20 20:46:33
|
Update of /cvsroot/mingw/man/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv13447/src Modified Files: Makefile.in compat.h man.c Log Message: Map default user locale on Win32 to ISO-639 language code. Index: man.c =================================================================== RCS file: /cvsroot/mingw/man/src/man.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** man.c 18 Mar 2008 20:53:47 -0000 1.8 --- man.c 20 Mar 2008 20:46:30 -0000 1.9 *************** *** 20,23 **** --- 20,24 ---- * Split off of manfile for man2html, aeb, New Year's Eve 1997 * Portability enhancements - kdm, June 2005 + * Remove `do_win32' rubbish - kdm, March 2008 */ #include "compat.h" *************** *** 1298,1301 **** --- 1299,1318 ---- + /* For internationalisation, we expect to be able to identify an + * ISO-639 two character language code from the LC_ALL, LC_MESSAGES + * or, (as a final fallback), from the LANG environment variables, + * or failing that, from a call to `setlocale'. On Win32, typically, + * NONE of these variables will be set, and the native `setlocale' + * implementation doesn't give us the ISO-639 format we require; + * to work around this, the following macro, defined in compat.h, + * uses an alternative Win32 API to get the ISO-639 code for the + * user's default locale, saving it in the LANG environment variable, + * for us to use later; (the user may override this, by explicitly + * setting LANG first). On platforms other than Win32, (and even + * on Win32 with Cygwin emulation of POSIX), this macro normally + * does nothing, (but see compat.h for possible exceptions). + */ + set_iso639_default("LANG"); + /* #ifndef __FreeBSD__ */ /* Slaven Rezif: FreeBSD-2.2-SNAP does not recognize LC_MESSAGES. */ Index: Makefile.in =================================================================== RCS file: /cvsroot/mingw/man/src/Makefile.in,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Makefile.in 10 Feb 2008 15:20:20 -0000 1.20 --- Makefile.in 20 Mar 2008 20:46:30 -0000 1.21 *************** *** 4,8 **** # Copyright (C) 1990, 1991, John W. Eaton. # Copyright (C) 1994-2001, Andries E. Brouwer ! # Copyright (C) 2005, Keith D. Marshall <kei...@us...> # # This file is part of the man package. --- 4,9 ---- # Copyright (C) 1990, 1991, John W. Eaton. # Copyright (C) 1994-2001, Andries E. Brouwer ! # Copyright (C) 2005-2008, Keith D. Marshall ! # <kei...@us...> # # This file is part of the man package. *************** *** 78,82 **** glob.$(OBJEXT) util.$(OBJEXT) msg.$(OBJEXT) ! WIN32LIBOBJS = winposix.$(OBJEXT) wincmds.$(OBJEXT) \ spawnlp.$(OBJEXT) spawnvp.$(OBJEXT) quotearg.$(OBJEXT) --- 79,83 ---- glob.$(OBJEXT) util.$(OBJEXT) msg.$(OBJEXT) ! WIN32LIBOBJS = winposix.$(OBJEXT) wincmds.$(OBJEXT) winlang.$(OBJEXT) \ spawnlp.$(OBJEXT) spawnvp.$(OBJEXT) quotearg.$(OBJEXT) Index: compat.h =================================================================== RCS file: /cvsroot/mingw/man/src/compat.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** compat.h 18 Mar 2008 20:53:47 -0000 1.8 --- compat.h 20 Mar 2008 20:46:30 -0000 1.9 *************** *** 126,129 **** --- 126,137 ---- extern int win32_run_command_sequence(const char *); + /* + * Establishing the ISO-639 language code, for selection of national + * language man pages, and message catalogues. + */ + #define set_iso639_default(VAR) win32_iso639_default((VAR)) + + extern void win32_iso639_default(const char *); + #else /* !_WIN32 */ *************** *** 165,167 **** --- 173,184 ---- #endif + #ifndef set_iso639_default + /* + * On most platforms, we don't need any special provision to + * establish the ISO-639 language code associated with the user's + * locale; it is implicit within the native locale implementation. + */ + #define set_iso639_default(VAR) /* do nothing */ + #endif + #endif /* COMPAT_H */ |