[gdk-pixbuf] lib: Clean up gettext handling
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf] lib: Clean up gettext handling
- Date: Fri, 24 Oct 2014 08:31:22 +0000 (UTC)
commit f37f850abe714f19cd3d7e2d5e3bd93483d1ec8a
Author: Bastien Nocera <hadess hadess net>
Date: Fri Oct 24 10:27:06 2014 +0200
lib: Clean up gettext handling
Use glib's i18n support rather than copy pasting it. Note that
gdk_pixbuf_gettext() is kept as it's an exported symbol.
gdk-pixbuf/Makefile.am | 1 -
gdk-pixbuf/gdk-pixbuf-i18n.h | 36 ------------------------------------
gdk-pixbuf/gdk-pixbuf-private.h | 4 +++-
gdk-pixbuf/gdk-pixbuf-util.c | 8 ++++++--
gdk-pixbuf/gdk-pixbuf.c | 4 +++-
5 files changed, 12 insertions(+), 41 deletions(-)
---
diff --git a/gdk-pixbuf/Makefile.am b/gdk-pixbuf/Makefile.am
index 9be1762..08031c9 100644
--- a/gdk-pixbuf/Makefile.am
+++ b/gdk-pixbuf/Makefile.am
@@ -553,7 +553,6 @@ gdk_pixbuf_query_loaders_SOURCES = queryloaders.c
#
libgdk_pixbufincludedir = $(includedir)/gdk-pixbuf-2.0/gdk-pixbuf
libgdk_pixbuf_2_0_la_SOURCES = \
- gdk-pixbuf-i18n.h \
gdk-pixbuf.c \
gdk-pixbuf-animation.c \
gdk-pixbuf-data.c \
diff --git a/gdk-pixbuf/gdk-pixbuf-private.h b/gdk-pixbuf/gdk-pixbuf-private.h
index 5628dda..822cf9c 100644
--- a/gdk-pixbuf/gdk-pixbuf-private.h
+++ b/gdk-pixbuf/gdk-pixbuf-private.h
@@ -28,11 +28,11 @@
#include <stdio.h>
#include <glib-object.h>
+#include <glib/gi18n.h>
#include "gdk-pixbuf-core.h"
#include "gdk-pixbuf-loader.h"
#include "gdk-pixbuf-io.h"
-#include "gdk-pixbuf-i18n.h"
#define LOAD_BUFFER_SIZE 65536
#define SNIFF_BUFFER_SIZE 4096
@@ -113,6 +113,8 @@ GdkPixbufFormat *_gdk_pixbuf_get_format (GdkPixbufModule *image_module);
GdkPixbuf * _gdk_pixbuf_new_from_resource_try_mmap (const char *resource_path);
GdkPixbufLoader *_gdk_pixbuf_loader_new_with_filename (const char *filename);
+void gdk_pixbuf_init_gettext (void);
+
#endif /* GDK_PIXBUF_PRIVATE_H */
#ifdef GDK_PIXBUF_RELOCATABLE
diff --git a/gdk-pixbuf/gdk-pixbuf-util.c b/gdk-pixbuf/gdk-pixbuf-util.c
index 49d44f6..3310a78 100644
--- a/gdk-pixbuf/gdk-pixbuf-util.c
+++ b/gdk-pixbuf/gdk-pixbuf-util.c
@@ -378,8 +378,8 @@ get_localedir (void)
#endif
-const gchar *
-gdk_pixbuf_gettext (const gchar *msgid)
+void
+gdk_pixbuf_init_gettext (void)
{
static gsize gettext_initialized = FALSE;
@@ -390,6 +390,10 @@ gdk_pixbuf_gettext (const gchar *msgid)
#endif
g_once_init_leave (&gettext_initialized, TRUE);
}
+}
+const gchar *
+gdk_pixbuf_gettext (const gchar *msgid)
+{
return g_dgettext (GETTEXT_PACKAGE, msgid);
}
diff --git a/gdk-pixbuf/gdk-pixbuf.c b/gdk-pixbuf/gdk-pixbuf.c
index 18bfae7..1a85f70 100644
--- a/gdk-pixbuf/gdk-pixbuf.c
+++ b/gdk-pixbuf/gdk-pixbuf.c
@@ -140,7 +140,9 @@ static void
gdk_pixbuf_class_init (GdkPixbufClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
+
+ gdk_pixbuf_init_gettext ();
+
object_class->finalize = gdk_pixbuf_finalize;
object_class->set_property = gdk_pixbuf_set_property;
object_class->get_property = gdk_pixbuf_get_property;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]