From 872bb0c517c567c6b110a7ab26a47798b5b30555 Mon Sep 17 00:00:00 2001 From: Dan Breslau Date: Wed, 24 Aug 2016 17:25:39 -0400 Subject: [PATCH] Fixed translatable strings --- src/moonshot-idcard-widget.vala | 14 +++++++------- src/moonshot-identity-management-view.vala | 8 ++++---- src/moonshot-identity-manager-app.vala | 5 +++-- src/moonshot-trust-anchor-dialog.vala | 2 +- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/moonshot-idcard-widget.vala b/src/moonshot-idcard-widget.vala index 487b0e7..03f4d61 100644 --- a/src/moonshot-idcard-widget.vala +++ b/src/moonshot-idcard-widget.vala @@ -128,24 +128,24 @@ class IdCardWidget : Box update_id_card_label() { // !!TODO: Use a table to format the labels and values - string service_spacer = _("\n "); + string service_spacer = "\n "; var display_name = (manager_view.selection_in_progress() && this.id_card.is_no_identity() - ? "Do not use a Moonshot identity for this service" : this.id_card.display_name); - var label_text = Markup.printf_escaped(_("%s"), display_name); + ? _("Do not use a Moonshot identity for this service") : this.id_card.display_name); + var label_text = Markup.printf_escaped("%s", display_name); if (is_selected) { if (!this.id_card.is_no_identity()) { - label_text += "\nUsername: " + id_card.username; - label_text += "\nRealm: " + id_card.issuer; + label_text += "\n" + _("Username") + ": " + id_card.username; + label_text += "\n" + _("Realm:") + " " + id_card.issuer; if (!id_card.trust_anchor.is_empty()) { - label_text += _("\nTrust anchor: Enterprise provisioned"); + label_text += "\n" + _("Trust anchor: Enterprise provisioned"); } } string services_text = _("Services: ") + this.id_card.get_services_string(service_spacer); - label_text += _("\n") + services_text; + label_text += "\n" + services_text; } label.set_markup(label_text); diff --git a/src/moonshot-identity-management-view.vala b/src/moonshot-identity-management-view.vala index c91d0e1..c4a8a1a 100644 --- a/src/moonshot-identity-management-view.vala +++ b/src/moonshot-identity-management-view.vala @@ -748,7 +748,7 @@ SUCH DAMAGE. this.search_entry.key_press_event.connect(search_entry_key_press_event_cb); this.search_entry.set_width_chars(24); - var search_label_markup =_("") + search_tooltip_text + _(""); + var search_label_markup ="" + search_tooltip_text + ""; var full_search_label = new Label(null); full_search_label.set_markup(search_label_markup); full_search_label.set_alignment(1, 0); @@ -868,9 +868,9 @@ SUCH DAMAGE. if (selection_in_progress()) { var result = WarningDialog.confirm(this, Markup.printf_escaped( - _("Do you wish to use the %s service?"), + "" + _("Do you wish to use the %s service?") + "", this.request_queue.peek_head().service) - + _("\n\nSelect Yes to select an ID for this service, or No to cancel"), + + "\n\n" + _("Select Yes to select an ID for this service, or No to cancel"), "close_moonshot_window"); if (result) { // Prevent other handlers from handling this event; this keeps the window open. @@ -892,7 +892,7 @@ SUCH DAMAGE. } private void import_identities_cb() { - var dialog = new FileChooserDialog("Import File", + var dialog = new FileChooserDialog(_("Import File"), this, FileChooserAction.OPEN, _("Cancel"),ResponseType.CANCEL, diff --git a/src/moonshot-identity-manager-app.vala b/src/moonshot-identity-manager-app.vala index cb109e1..0170139 100644 --- a/src/moonshot-identity-manager-app.vala +++ b/src/moonshot-identity-manager-app.vala @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014, JANET(UK) + * Copyright (c) 2011-2016, JANET(UK) * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -292,7 +292,7 @@ public class IdentityManagerApp { if (!shown) { GLib.error("Couldn't own name org.janet.Moonshot on dbus or show previously launched identity manager."); } else { - stdout.printf("Showed previously launched identity manager.\n"); + stdout.printf(_("Showed previously launched identity manager.\n")); GLib.Process.exit(0); } } @@ -456,6 +456,7 @@ public static int main(string[] args) { settings.set_long_property("gtk-menu-images", 0, "moonshot"); #endif + //TODO?? Do we need to call Intl.setlocale(LocaleCategory.MESSAGES, ""); Intl.bindtextdomain(Config.GETTEXT_PACKAGE, Config.LOCALEDIR); Intl.bind_textdomain_codeset(Config.GETTEXT_PACKAGE, "UTF-8"); Intl.textdomain(Config.GETTEXT_PACKAGE); diff --git a/src/moonshot-trust-anchor-dialog.vala b/src/moonshot-trust-anchor-dialog.vala index 20def57..695aa63 100644 --- a/src/moonshot-trust-anchor-dialog.vala +++ b/src/moonshot-trust-anchor-dialog.vala @@ -56,7 +56,7 @@ class TrustAnchorDialog : Dialog Label dialog_label = new Label(""); dialog_label.set_alignment(0, 0); - string label_markup = _("You are using this identity for the first time with the following trust anchor:"); + string label_markup = "" + _("You are using this identity for the first time with the following trust anchor:") + ""; dialog_label.set_markup(label_markup); dialog_label.set_line_wrap(true); -- 2.1.4