patches: update lighttpd patches
[git-osx-installer.git] / src / gettext-culled.c
blobd2683cfe4eef0d3d9c1640d4aee593238c880854
1 #ifdef GETTEXT_DEFINES_GET_PREFERRED_LANGUAGES
3 /* From the original gettext.c file after the Add Accept-Language patch added */
5 const char *get_preferred_languages(void);
7 /*
8 * Guess the user's preferred languages from the value in LANGUAGE environment
9 * variable and LC_MESSAGES locale category if NO_GETTEXT is not defined.
11 * The result can be a colon-separated list like "ko:ja:en".
13 const char *get_preferred_languages(void)
15 const char *retval;
17 retval = getenv("LANGUAGE");
18 if (retval && *retval)
19 return retval;
21 #ifndef NO_GETTEXT
22 retval = setlocale(LC_MESSAGES, NULL);
23 if (retval && *retval &&
24 strcmp(retval, "C") &&
25 strcmp(retval, "POSIX"))
26 return retval;
27 #endif
29 return NULL;
32 #endif /* GETTEXT_DEFINES_GET_PREFERRED_LANGUAGES */