[libgsf] Thumbnailer: i18n support.



commit d9bca9b515bef0fdbf3400e228d483eca1a21d0a
Author: Morten Welinder <terra gnome org>
Date:   Thu Jan 21 15:34:26 2016 -0500

    Thumbnailer: i18n support.

 ChangeLog               |    5 +++++
 NEWS                    |    3 +++
 thumbnailer/Makefile.am |    5 ++++-
 thumbnailer/main.c      |   10 ++++++++--
 4 files changed, 20 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fda8cf3..e8414a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-01-21  Morten Welinder  <terra gnome org>
+
+       * tools/gsf.c (main): Set of locale stuff.  Patch by Ting-Wei Lan.
+       Also set up gettext stuff.
+
 2016-01-13  Morten Welinder  <terra gnome org>
 
        * gsf/gsf-infile-zip.c (gsf_infile_zip_read): Improve error
diff --git a/NEWS b/NEWS
index ea1e45b..64b2360 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,9 @@ Morten:
        * Fix OLE2 property writing issue.  [#760047]
        * Improve handling of broken zip files.  [#760543]
 
+Ting-Wei Lan:
+       * Fix locale handling in thumbnailer.  [#760428]
+
 --------------------------------------------------------------------------
 libgsf 1.14.34
 
diff --git a/thumbnailer/Makefile.am b/thumbnailer/Makefile.am
index 0859fc7..9989017 100644
--- a/thumbnailer/Makefile.am
+++ b/thumbnailer/Makefile.am
@@ -1,4 +1,7 @@
-AM_CPPFLAGS = -I$(top_srcdir) $(LIBGSF_CFLAGS) $(GDK_PIXBUF_CFLAGS) $(LIBXML_CFLAGS)
+AM_CPPFLAGS = -I$(top_srcdir) $(LIBGSF_CFLAGS) \
+       $(GDK_PIXBUF_CFLAGS) $(LIBXML_CFLAGS) \
+       -DGSFLOCALEDIR=\"$(localedir)\"
+
 LDADD = $(top_builddir)/gsf/libgsf-1.la $(LIBGSF_LIBS) $(GDK_PIXBUF_LIBS)
 
 bin_PROGRAMS = gsf-office-thumbnailer
diff --git a/thumbnailer/main.c b/thumbnailer/main.c
index df59d7b..4e8121d 100644
--- a/thumbnailer/main.c
+++ b/thumbnailer/main.c
@@ -21,9 +21,11 @@
 
 #include <gsf-config.h>
 #include <gsf/gsf.h>
+#include <locale.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <glib.h>
+#include <glib/gi18n.h>
 
 #ifdef HAVE_GDK_PIXBUF
 #include <gdk-pixbuf/gdk-pixbuf.h>
@@ -292,8 +294,12 @@ main (int argc, char **argv)
 
        set_resource_limits ();
 
-       option_ctx = g_option_context_new ("Options");
-       g_option_context_add_main_entries (option_ctx, option_entries, NULL); /* FIXME: no translation domain 
*/
+       bindtextdomain (GETTEXT_PACKAGE, GSFLOCALEDIR);
+       textdomain (GETTEXT_PACKAGE);
+       setlocale (LC_ALL, "");
+
+       option_ctx = g_option_context_new (_("Options"));
+       g_option_context_add_main_entries (option_ctx, option_entries, GETTEXT_PACKAGE);
        if (!g_option_context_parse (option_ctx, &argc, &argv, NULL)
            || option_size == -1
            || option_input_filename == NULL


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