[cogl/wip/neil/master-next: 4/11] cogl: Bind the locale dir for the Cogl domain



commit 4ed8993bf69650577df915a98c221fe9b387a582
Author: Neil Roberts <neil linux intel com>
Date:   Sat Sep 10 09:51:42 2011 +0100

    cogl: Bind the locale dir for the Cogl domain
    
    dgettext (which Cogl is using) doesn't work unless you first tell
    gettext where the locale dir is for the library's domain. This just
    adds the necessary calls into _cogl_init.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=658700

 cogl/Makefile.am |    1 +
 cogl/cogl.c      |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/cogl/Makefile.am b/cogl/Makefile.am
index 2caf098..b80ad8f 100644
--- a/cogl/Makefile.am
+++ b/cogl/Makefile.am
@@ -31,6 +31,7 @@ AM_CPPFLAGS = \
 	-DCOGL_GL_LIBNAME=\"$(COGL_GL_LIBNAME)\" \
 	-DCOGL_GLES1_LIBNAME=\"$(COGL_GLES1_LIBNAME)\" \
 	-DCOGL_GLES2_LIBNAME=\"$(COGL_GLES2_LIBNAME)\" \
+	-DCOGL_LOCALEDIR=\""$(localedir)"\" \
 	$(NULL)
 
 AM_CFLAGS = $(COGL_DEP_CFLAGS) $(COGL_EXTRA_CFLAGS) $(MAINTAINER_CFLAGS)
diff --git a/cogl/cogl.c b/cogl/cogl.c
index 67231f4..09efc8a 100644
--- a/cogl/cogl.c
+++ b/cogl/cogl.c
@@ -30,6 +30,7 @@
 #include <string.h>
 #include <math.h>
 #include <stdlib.h>
+#include <glib/gi18n-lib.h>
 
 #include "cogl-debug.h"
 #include "cogl-internal.h"
@@ -1121,6 +1122,9 @@ _cogl_init (void)
 
   if (g_once_init_enter (&init_status))
     {
+      bindtextdomain (GETTEXT_PACKAGE, COGL_LOCALEDIR);
+      bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+
       g_type_init ();
 
       _cogl_config_read ();



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