[gnome-shell] [clockPreferences] Fix translations



commit 764f5b62f01d7cb6372dac5a1aae95690ff8074d
Author: Florian Müllner <fmuellner src gnome org>
Date:   Mon May 17 14:03:47 2010 +0200

    [clockPreferences] Fix translations
    
    The preference dialog for the panel clock does not set its gettext
    domain, so it's not translated even if though translations are
    already available.
    Fix by setting the domain in the GtkBuilder file and binding the
    domain to the locale directory.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=618873

 data/clock-preferences.ui            |    2 +-
 js/prefs/clockPreferences.js         |    5 +++++
 src/Makefile.am                      |    1 +
 src/gnome-shell-clock-preferences.in |    5 ++++-
 4 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/data/clock-preferences.ui b/data/clock-preferences.ui
index cc04f72..2e22d9a 100644
--- a/data/clock-preferences.ui
+++ b/data/clock-preferences.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<interface>
+<interface domain="gnome-shell">
   <requires lib="gtk+" version="2.16"/>
   <!-- interface-naming-policy project-wide -->
   <object class="GtkDialog" id="prefs-dialog">
diff --git a/js/prefs/clockPreferences.js b/js/prefs/clockPreferences.js
index 757eb7c..180358b 100644
--- a/js/prefs/clockPreferences.js
+++ b/js/prefs/clockPreferences.js
@@ -7,6 +7,8 @@ const GConf = imports.gi.GConf;
 const Lang = imports.lang;
 const Signals = imports.signals;
 
+const Gettext = imports.gettext;
+
 const GCONF_DIR        = '/desktop/gnome/shell/clock';
 const FORMAT_KEY       = GCONF_DIR + '/format';
 const SHOW_DATE_KEY    = GCONF_DIR + '/show_date';
@@ -80,6 +82,9 @@ Signals.addSignalMethods(ClockPreferences.prototype);
 function main(params) {
     if ('progName' in params)
         GLib.set_prgname(params['progName']);
+    if ('localeDir' in params)
+        Gettext.bindtextdomain('gnome-shell', params['localeDir']);
+
     Gtk.init(null, null);
 
     let clockPrefs = new ClockPreferences(params['uiFile']);
diff --git a/src/Makefile.am b/src/Makefile.am
index 6200dc5..5ab98c3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -26,6 +26,7 @@ EXTRA_DIST += gnome-shell.in
 
 gnome-shell-clock-preferences: gnome-shell-clock-preferences.in
 	$(AM_V_GEN) sed -e "s|@pkgdatadir[ ]|$(pkgdatadir)|" \
+	    -e "s|@localedir[ ]|$(datadir)/locale|" \
 	    -e "s|@GJS_CONSOLE[ ]|$(GJS_CONSOLE)|" \
 	    $< > $@ && chmod a+x $@
 CLEANFILES += gnome-shell-clock-preferences
diff --git a/src/gnome-shell-clock-preferences.in b/src/gnome-shell-clock-preferences.in
index 419d008..9c471ab 100644
--- a/src/gnome-shell-clock-preferences.in
+++ b/src/gnome-shell-clock-preferences.in
@@ -11,8 +11,11 @@ else
 fi
 
 progName="`basename $0`"
+localeDir="@localedir@"
 uiFile="$uiDir/clock-preferences.ui"
 export GJS_PATH="$jsDir"
 
 @GJS_CONSOLE@ -c "const ClockPreferences = imports.prefs.clockPreferences;
-ClockPreferences.main({ progName: '$progName', uiFile: '$uiFile' });"
+ClockPreferences.main({ progName: '$progName',
+                        uiFile: '$uiFile',
+                        localeDir: '$localeDir' });"



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