[gnome-control-center/gnome-2-32] Use translations from fprintd for finger ops



commit 10c8aa46a7d642d4b661a2ed7eefbf451a8fefac
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Sep 8 18:56:28 2010 +0100

    Use translations from fprintd for finger ops
    
    Rather than rely on the translators doing double-work.
    This also means translations are actually used...

 capplets/about-me/gnome-about-me-fingerprint.c |   14 ++++++++++----
 po/POTFILES.in                                 |    1 -
 po/POTFILES.skip                               |    1 +
 3 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/capplets/about-me/gnome-about-me-fingerprint.c b/capplets/about-me/gnome-about-me-fingerprint.c
index 88b1d4f..ce349cd 100644
--- a/capplets/about-me/gnome-about-me-fingerprint.c
+++ b/capplets/about-me/gnome-about-me-fingerprint.c
@@ -27,6 +27,9 @@
 /* This must match the number of images on the 2nd page in the UI file */
 #define MAX_ENROLL_STAGES 5
 
+/* Translate fprintd strings */
+#define TR(s) dgettext("fprintd", s)
+
 static DBusGProxy *manager = NULL;
 static DBusGConnection *connection = NULL;
 static gboolean is_disable = FALSE;
@@ -306,7 +309,7 @@ finger_radio_button_toggled (GtkToggleButton *button, EnrollData *data)
 
 	data->finger = selected_finger (data->dialog);
 
-	msg = g_strdup_printf (finger_str_to_msg (data->finger, data->is_swipe), data->name);
+	msg = g_strdup_printf (TR(finger_str_to_msg (data->finger, data->is_swipe)), data->name);
 	gtk_label_set_text (GTK_LABEL (WID("enroll-label")), msg);
 	g_free (msg);
 }
@@ -319,7 +322,7 @@ finger_combobox_changed (GtkComboBox *combobox, EnrollData *data)
 
 	data->finger = selected_finger (data->dialog);
 
-	msg = g_strdup_printf (finger_str_to_msg (data->finger, data->is_swipe), data->name);
+	msg = g_strdup_printf (TR(finger_str_to_msg (data->finger, data->is_swipe)), data->name);
 	gtk_label_set_text (GTK_LABEL (WID("enroll-label")), msg);
 	g_free (msg);
 }
@@ -370,7 +373,7 @@ enroll_result (GObject *object, const char *result, gboolean done, EnrollData *d
 		}
 	}
 
-	msg = g_strdup_printf (enroll_result_str_to_msg (result, data->is_swipe), data->name);
+	msg = g_strdup_printf (TR(enroll_result_str_to_msg (result, data->is_swipe)), data->name);
 	gtk_label_set_text (GTK_LABEL (WID ("status-label")), msg);
 	g_free (msg);
 }
@@ -593,7 +596,7 @@ enroll_fingerprints (GtkWindow *parent, GtkWidget *enable, GtkWidget *disable)
 
 	g_object_set_data (G_OBJECT (WID("page2")), "name", "enroll");
 
-	msg = g_strdup_printf (finger_str_to_msg (data->finger, data->is_swipe), data->name);
+	msg = g_strdup_printf (TR(finger_str_to_msg (data->finger, data->is_swipe)), data->name);
 	gtk_label_set_text (GTK_LABEL (WID("enroll-label")), msg);
 	g_free (msg);
 
@@ -609,6 +612,9 @@ fingerprint_button_clicked (GtkBuilder *dialog,
 			    GtkWidget *enable,
 			    GtkWidget *disable)
 {
+	bindtextdomain ("fprintd", GNOMELOCALEDIR);
+	bind_textdomain_codeset ("fprintd", "UTF-8");
+
 	if (is_disable != FALSE) {
 		delete_fingerprints_question (dialog, enable, disable);
 	} else {
diff --git a/po/POTFILES.in b/po/POTFILES.in
index fbcabf4..9364db8 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -4,7 +4,6 @@
 gnome-control-center.schemas.in
 capplets/about-me/eel-alert-dialog.c
 capplets/about-me/e-image-chooser.c
-capplets/about-me/fingerprint-strings.h
 capplets/about-me/gnome-about-me.c
 [type: gettext/glade]capplets/about-me/gnome-about-me-dialog.ui
 capplets/about-me/gnome-about-me.desktop.in.in
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index 1ac7639..0b42c1f 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -1,4 +1,5 @@
 capplets/about-me/gnome-about-me.desktop.in
+capplets/about-me/fingerprint-strings.h
 capplets/accessibility/at-properties/at-properties.desktop.in
 capplets/accessibility/keyboard/accessibility-keyboard.desktop.in
 capplets/appearance/data/gnome-appearance-properties.desktop.in



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