[accounts-dialog] Use translations from fprintd for finger ops



commit 722244f072587b331fffdc7599a91f3f399351cc
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Sep 8 18:55:31 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...

 po/POTFILES.in              |    1 -
 po/POTFILES.skip            |    1 +
 src/um-fingerprint-dialog.c |   14 ++++++++++----
 3 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 9c5d68a..d997b63 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,5 @@
 # List of source files which contain translatable strings.
 [encoding: UTF-8]
-src/fingerprint-strings.h
 src/gdm-languages.c
 src/run-passwd.c
 src/um-account-dialog.c
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index 730ca6a..1cb30d6 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -1,3 +1,4 @@
 doc/user-accounts-main.glade
 doc/user-accounts-main2.glade
 doc/user-accounts-main3.glade
+src/fingerprint-strings.h
diff --git a/src/um-fingerprint-dialog.c b/src/um-fingerprint-dialog.c
index 2147609..de11c95 100644
--- a/src/um-fingerprint-dialog.c
+++ b/src/um-fingerprint-dialog.c
@@ -31,6 +31,9 @@
 /* Retrieve a widget from the UI object */
 #define WID(s) GTK_WIDGET (gtk_builder_get_object (dialog, s))
 
+/* Translate fprintd strings */
+#define TR(s) dgettext("fprintd", s)
+
 /* This must match the number of images on the 2nd page in the UI file */
 #define MAX_ENROLL_STAGES 5
 
@@ -310,7 +313,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);
 }
@@ -323,7 +326,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);
 }
@@ -374,7 +377,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);
 }
@@ -642,7 +645,7 @@ enroll_fingerprints (GtkWindow *parent,
         /* Page 2 */
         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);
 
@@ -659,6 +662,9 @@ fingerprint_button_clicked (GtkWindow *parent,
                             GtkWidget *label2,
                             UmUser    *user)
 {
+        bindtextdomain ("fprintd", GNOMELOCALEDIR);
+        bind_textdomain_codeset ("fprintd", "UTF-8");
+
         if (is_disable != FALSE) {
                 delete_fingerprints_question (parent, label1, label2, user);
         } else {



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