summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2011-07-05 14:30:31 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-10-18 17:08:13 +0100
commite72314f369c5567796eef433d40d0a7045d2d531 (patch)
tree588d16804729ff3cffc9413b5e136a3af6c86a79
parent21b10392a3265f833cddc44cc7e8a2ecbc0f492d (diff)
tests: fix glib_translations_work()glib-2-28
If setlocale() to our test locale fails, translations won't work either. https://bugzilla.gnome.org/show_bug.cgi?id=654017
-rw-r--r--gio/tests/gsettings.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gio/tests/gsettings.c b/gio/tests/gsettings.c
index b2f9d4fa4..b70ff4e39 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"