[gnome-contacts] Add context for "Link" messages



commit 05d276eca9f786ac02a2625e4991a94e413fa598
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Sep 5 10:28:52 2011 +0200

    Add context for "Link" messages
    
    This is used differently in different places.
    Fixes bug #658082

 src/contacts-contact-pane.vala |    3 ++-
 src/contacts-link-dialog.vala  |    3 ++-
 vapi/custom.vapi               |    6 ++++++
 3 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/contacts-contact-pane.vala b/src/contacts-contact-pane.vala
index 6407f5c..7ce5ab4 100644
--- a/src/contacts-contact-pane.vala
+++ b/src/contacts-contact-pane.vala
@@ -20,6 +20,7 @@
 using Gtk;
 using Folks;
 using Gee;
+using LocalGLib; // For C_
 
 public class Contacts.ContactFrame : Frame {
   private int size;
@@ -815,7 +816,7 @@ public class Contacts.ContactPane : Grid {
 	  });
       }
       if (Contact.persona_has_writable_property (persona, "urls")) {
-	Utils.add_menu_item (menu,_("Link")).activate.connect ( () => {
+	Utils.add_menu_item (menu, C_ ("url-link", "Link")).activate.connect ( () => {
 	    var widget = add_url_editor (url_layout,
 					 editing_urls,
 					 null);
diff --git a/src/contacts-link-dialog.vala b/src/contacts-link-dialog.vala
index 325e396..ee0d303 100644
--- a/src/contacts-link-dialog.vala
+++ b/src/contacts-link-dialog.vala
@@ -19,6 +19,7 @@
 
 using Gtk;
 using Folks;
+using LocalGLib; // For C_
 
 public class Contacts.LinkDialog : Dialog {
   private Contact contact;
@@ -141,7 +142,7 @@ public class Contacts.LinkDialog : Dialog {
     toolbar.set_vexpand (false);
     list_grid.add (toolbar);
 
-    var link_button = new ToolButton (null, _("Link"));
+    var link_button = new ToolButton (null, C_("link-button", "Link"));
     link_button.get_style_context ().add_class (STYLE_CLASS_RAISED);
     link_button.is_important = true;
     link_button.sensitive = false;
diff --git a/vapi/custom.vapi b/vapi/custom.vapi
index 73f0a5f..f03a12a 100644
--- a/vapi/custom.vapi
+++ b/vapi/custom.vapi
@@ -16,3 +16,9 @@ namespace Gnome {
 		LARGE
 	}
 }
+
+[CCode (cprefix = "G", lower_case_cprefix = "g_", cheader_filename = "glib.h", gir_namespace = "GLib", gir_version = "2.0")]
+namespace LocalGLib {
+	[CCode (cname = "C_", cheader_filename = "glib.h,glib/gi18n-lib.h")]
+	public static unowned string C_ (string contect, string str);
+}



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