Don't make locale code dependent on GETTEXT, save that for the actual gettext related stuff!
This commit is contained in:
parent
e1303a2b5c
commit
9c8988ab57
|
@ -1046,10 +1046,8 @@ void D_SRB2Main(void)
|
||||||
I_OutputMsg("setvbuf didnt work\n");
|
I_OutputMsg("setvbuf didnt work\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GETTEXT
|
|
||||||
// initialise locale code
|
// initialise locale code
|
||||||
M_StartupLocale();
|
M_StartupLocale();
|
||||||
#endif
|
|
||||||
|
|
||||||
// get parameters from a response file (eg: srb2 @parms.txt)
|
// get parameters from a response file (eg: srb2 @parms.txt)
|
||||||
M_FindResponseFile();
|
M_FindResponseFile();
|
||||||
|
|
|
@ -98,8 +98,8 @@
|
||||||
|
|
||||||
#ifdef GETTEXT
|
#ifdef GETTEXT
|
||||||
#include <libintl.h>
|
#include <libintl.h>
|
||||||
#include <locale.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
#include <locale.h> // locale should not be dependent on GETTEXT -- 11/01/20 Monster Iestyn
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
18
src/m_misc.c
18
src/m_misc.c
|
@ -1594,16 +1594,19 @@ boolean M_ScreenshotResponder(event_t *ev)
|
||||||
// M_StartupLocale.
|
// M_StartupLocale.
|
||||||
// Sets up gettext to translate SRB2's strings.
|
// Sets up gettext to translate SRB2's strings.
|
||||||
#ifdef GETTEXT
|
#ifdef GETTEXT
|
||||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||||
#define GETTEXTDOMAIN1 "/usr/share/locale"
|
#define GETTEXTDOMAIN1 "/usr/share/locale"
|
||||||
#define GETTEXTDOMAIN2 "/usr/local/share/locale"
|
#define GETTEXTDOMAIN2 "/usr/local/share/locale"
|
||||||
#elif defined (_WIN32)
|
#elif defined (_WIN32)
|
||||||
#define GETTEXTDOMAIN1 "."
|
#define GETTEXTDOMAIN1 "."
|
||||||
#endif
|
#endif
|
||||||
|
#endif // GETTEXT
|
||||||
|
|
||||||
void M_StartupLocale(void)
|
void M_StartupLocale(void)
|
||||||
{
|
{
|
||||||
|
#ifdef GETTEXT
|
||||||
char *textdomhandle = NULL;
|
char *textdomhandle = NULL;
|
||||||
|
#endif //GETTEXT
|
||||||
|
|
||||||
CONS_Printf("M_StartupLocale...\n");
|
CONS_Printf("M_StartupLocale...\n");
|
||||||
|
|
||||||
|
@ -1612,6 +1615,7 @@ void M_StartupLocale(void)
|
||||||
// Do not set numeric locale as that affects atof
|
// Do not set numeric locale as that affects atof
|
||||||
setlocale(LC_NUMERIC, "C");
|
setlocale(LC_NUMERIC, "C");
|
||||||
|
|
||||||
|
#ifdef GETTEXT
|
||||||
// FIXME: global name define anywhere?
|
// FIXME: global name define anywhere?
|
||||||
#ifdef GETTEXTDOMAIN1
|
#ifdef GETTEXTDOMAIN1
|
||||||
textdomhandle = bindtextdomain("srb2", GETTEXTDOMAIN1);
|
textdomhandle = bindtextdomain("srb2", GETTEXTDOMAIN1);
|
||||||
|
@ -1632,8 +1636,8 @@ void M_StartupLocale(void)
|
||||||
textdomain("srb2");
|
textdomain("srb2");
|
||||||
else
|
else
|
||||||
CONS_Printf("Could not find locale text domain!\n");
|
CONS_Printf("Could not find locale text domain!\n");
|
||||||
|
#endif //GETTEXT
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// MISC STRING FUNCTIONS
|
// MISC STRING FUNCTIONS
|
||||||
|
|
Loading…
Reference in New Issue