[gcab] libgcab: make it translatable



commit 7b9ab6a297d273746c71c5bf848620c4a7ed7a2f
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date:   Fri Jan 25 22:06:18 2013 +0100

    libgcab: make it translatable

 Makefile.am            |    4 ++++
 libgcab/cabinet.c      |    1 +
 libgcab/gcab-cabinet.c |    3 +++
 3 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 3869afc..8481286 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -42,6 +42,10 @@ libgcab_1_0_la_SOURCES =			\
 	libgcab/glib-compat.c			\
 	libgcab/glib-compat.h			\
 	$(NULL)
+libgcab_1_0_la_CPPFLAGS =				\
+	$(AM_CPPFLAGS)					\
+	-DGETTEXT_PACKAGE="\"$(GETTEXT_PACKAGE)\""	\
+	$(NULL)
 libgcab_1_0_la_LIBADD = -lz $(GLIB_LIBS)
 libgcab_1_0_la_LDFLAGS =				\
 	-version-info 0:0:0				\
diff --git a/libgcab/cabinet.c b/libgcab/cabinet.c
index 64669b8..c0e40ea 100644
--- a/libgcab/cabinet.c
+++ b/libgcab/cabinet.c
@@ -1,4 +1,5 @@
 #include "gcab-priv.h"
+#include <glib/gi18n-lib.h>
 
 static voidpf
 zalloc (voidpf opaque, uInt items, uInt size)
diff --git a/libgcab/gcab-cabinet.c b/libgcab/gcab-cabinet.c
index 0a6e981..df70a42 100644
--- a/libgcab/gcab-cabinet.c
+++ b/libgcab/gcab-cabinet.c
@@ -97,6 +97,9 @@ gcab_cabinet_class_init (GCabCabinetClass *klass)
 {
     GObjectClass* object_class = G_OBJECT_CLASS (klass);
 
+    bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+    bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+
     object_class->finalize = gcab_cabinet_finalize;
     object_class->set_property = gcab_cabinet_set_property;
     object_class->get_property = gcab_cabinet_get_property;



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