[gnome-photos] thumbnailer, thumbnailer-main: Set up i18n in PhotosThumbnailer



commit 452e57ef6d7f21a6a83815dd5b3cf5f6a52f4f7d
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Jan 5 19:55:28 2018 +0100

    thumbnailer, thumbnailer-main: Set up i18n in PhotosThumbnailer
    
    Ideally main() should only instantiate PhotosThumbnailer and run it,
    plus anything that needs to happen really early or late in the process'
    lifecycle. Internationalization isn't needed until there is some
    user-visible output, which can only happen once PhotosThumbnailer has
    been created.

 src/photos-thumbnailer-main.c | 9 ---------
 src/photos-thumbnailer.c      | 7 +++++++
 2 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/src/photos-thumbnailer-main.c b/src/photos-thumbnailer-main.c
index 10126fe4..2ecb2f9a 100644
--- a/src/photos-thumbnailer-main.c
+++ b/src/photos-thumbnailer-main.c
@@ -21,10 +21,7 @@
 
 #include "config.h"
 
-#include <locale.h>
-
 #include <glib.h>
-#include <glib/gi18n.h>
 
 #include "egg-counter.h"
 #include "photos-debug.h"
@@ -48,14 +45,8 @@ main (gint argc, gchar *argv[])
   GApplication *app;
   gint exit_status = 0;
 
-  setlocale (LC_ALL, "");
-
   photos_debug_init ();
 
-  bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
-  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-  textdomain (GETTEXT_PACKAGE);
-
   g_set_prgname (PACKAGE_TARNAME "-thumbnailer");
 
   app = photos_thumbnailer_new ();
diff --git a/src/photos-thumbnailer.c b/src/photos-thumbnailer.c
index 57ef9587..a206f646 100644
--- a/src/photos-thumbnailer.c
+++ b/src/photos-thumbnailer.c
@@ -21,6 +21,7 @@
 
 #include "config.h"
 
+#include <locale.h>
 #include <stdlib.h>
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
@@ -814,6 +815,12 @@ photos_thumbnailer_finalize (GObject *object)
 static void
 photos_thumbnailer_init (PhotosThumbnailer *self)
 {
+  setlocale (LC_ALL, "");
+
+  bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
+  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+  textdomain (GETTEXT_PACKAGE);
+
   photos_gegl_ensure_builtins ();
 
   self->cancellables = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, g_object_unref);


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