From: Tim-Philipp Müller Date: Tue, 5 Jul 2011 13:30:31 +0000 (+0100) Subject: tests: fix glib_translations_work() X-Git-Tag: 2.29.12~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7654a848e2b575eaf278fafe05aa5be1b3afdc26;p=platform%2Fupstream%2Fglib.git tests: fix glib_translations_work() If setlocale() to our test locale fails, translations won't work either. https://bugzilla.gnome.org/show_bug.cgi?id=654017 --- diff --git a/gio/tests/gsettings.c b/gio/tests/gsettings.c index e178a05..ded8098 100644 --- a/gio/tests/gsettings.c +++ b/gio/tests/gsettings.c @@ -1479,17 +1479,19 @@ test_child_schema (void) static gboolean glib_translations_work (void) { + gboolean works; gchar *locale; gchar *orig = "Unnamed"; - gchar *str; locale = g_strdup (setlocale (LC_MESSAGES, NULL)); - setlocale (LC_MESSAGES, "de"); - str = dgettext ("glib20", orig); + if (!setlocale (LC_MESSAGES, "de")) + works = FALSE; + else + works = dgettext ("glib20", orig) != orig; setlocale (LC_MESSAGES, locale); g_free (locale); - return str != orig; + return works; } #include "../strinfo.c"