[gnome-settings-daemon] print-notifications: Call setlocale()



commit 51d18a34405afd127fb83f0787928e32c8121b0a
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Oct 7 22:01:11 2011 +0100

    print-notifications: Call setlocale()
    
    So that translations work.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660632

 plugins/print-notifications/Makefile.am   |    5 +++--
 plugins/print-notifications/gsd-printer.c |    5 +++++
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/plugins/print-notifications/Makefile.am b/plugins/print-notifications/Makefile.am
index fa34ac9..48494d9 100644
--- a/plugins/print-notifications/Makefile.am
+++ b/plugins/print-notifications/Makefile.am
@@ -38,8 +38,9 @@ gsd_printer_SOURCES = 	\
 	gsd-printer.c
 
 gsd_printer_CFLAGS = \
-	$(SETTINGS_PLUGIN_CFLAGS)	\
-	$(LIBNOTIFY_CFLAGS)		\
+	$(SETTINGS_PLUGIN_CFLAGS)				\
+	$(LIBNOTIFY_CFLAGS)					\
+	-DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\"	\
 	$(AM_CFLAGS)
 
 gsd_printer_LDADD  = 		\
diff --git a/plugins/print-notifications/gsd-printer.c b/plugins/print-notifications/gsd-printer.c
index aa405bc..24cf5c8 100644
--- a/plugins/print-notifications/gsd-printer.c
+++ b/plugins/print-notifications/gsd-printer.c
@@ -1136,6 +1136,11 @@ main (int argc, char *argv[])
   guint pdi_owner_id;
   GMainLoop *loop;
 
+  bindtextdomain (GETTEXT_PACKAGE, GNOME_SETTINGS_LOCALEDIR);
+  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+  textdomain (GETTEXT_PACKAGE);
+  setlocale (LC_ALL, "");
+
   g_type_init ();
 
   notify_init ("gnome-settings-daemon-printer");



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