pbutils: don't assume LC_MESSAGES is always defined, also check for ENABLE_NLS

Should fix build with mingw32 build bot again.
This commit is contained in:
Tim-Philipp Müller 2011-01-18 01:06:50 +00:00
parent cd758cdbd9
commit d1bcdea7dc

View file

@ -412,9 +412,23 @@ serialize_stream_profiles (GKeyFile * out, GstEncodingProfile * sprof,
static gchar *
get_locale (void)
{
const char *loc = setlocale (LC_MESSAGES, NULL);
const char *loc = NULL;
gchar *ret;
#ifdef ENABLE_NLS
#if defined(LC_MESSAGES)
loc = setlocale (LC_MESSAGES, NULL);
GST_LOG ("LC_MESSAGES: %s", GST_STR_NULL (loc));
#elif defined(LC_ALL)
loc = setlocale (LC_ALL, NULL);
GST_LOG ("LC_ALL: %s", GST_STR_NULL (loc));
#else
GST_LOG ("Neither LC_ALL nor LC_MESSAGES defined");
#endif
#else /* !ENABLE_NLS */
GST_LOG ("i18n disabled");
#endif
if (loc == NULL || g_ascii_strncasecmp (loc, "en", 2) == 0)
return NULL;