[clutter] tests: Set locale in test-script.c



commit 363c3f8bf4196b4c94135bb0fcc0023d5eda261f
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Tue Aug 23 18:06:46 2016 +0100

    tests: Set locale in test-script.c
    
    So that if the translatable strings in test-script.json are ever
    translated in the .po files, they will appear translated in the test
    program.
    
    Note that for them to be translated in the .po files, they must first be
    extracted by gettext, which first needs to grow support for
    ClutterScript files.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770288

 tests/interactive/test-script.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/tests/interactive/test-script.c b/tests/interactive/test-script.c
index e30de3d..045a712 100644
--- a/tests/interactive/test-script.c
+++ b/tests/interactive/test-script.c
@@ -1,9 +1,13 @@
+#include "config.h"
+
+#include <locale.h>
 #include <stdlib.h>
 #include <stdio.h>
 
 #include <math.h>
 
 #include <glib.h>
+#include <glib/gi18n.h>
 #include <gmodule.h>
 #include <clutter/clutter.h>
 
@@ -138,6 +142,9 @@ test_script_main (int argc, char *argv[])
   gchar *file;
   gint res;
 
+  setlocale (LC_ALL, "");
+  textdomain (GETTEXT_PACKAGE);
+
   if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
     return 1;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]