From 8e6db8859c756ef2445e1f5277103d83c735c726 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Wed, 9 Oct 2019 23:32:03 +0200 Subject: Plugins: Set UI texts in code instead of .ui files to fix translations Co-authored-by: srgcdev --- plugins/omemo/src/ui/contact_details_dialog.vala | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'plugins/omemo/src/ui/contact_details_dialog.vala') diff --git a/plugins/omemo/src/ui/contact_details_dialog.vala b/plugins/omemo/src/ui/contact_details_dialog.vala index eee06f0f..463b5cd7 100644 --- a/plugins/omemo/src/ui/contact_details_dialog.vala +++ b/plugins/omemo/src/ui/contact_details_dialog.vala @@ -17,7 +17,11 @@ public class ContactDetailsDialog : Gtk.Dialog { private bool own = false; private int own_id = 0; + [GtkChild] private Label automatically_accept_new_label; [GtkChild] private Label automatically_accept_new_descr; + [GtkChild] private Label own_key_label; + [GtkChild] private Label new_keys_label; + [GtkChild] private Label associated_keys_label; [GtkChild] private Box own_fingerprint_container; [GtkChild] private Label own_fingerprint_label; [GtkChild] private Box new_keys_container; @@ -30,6 +34,16 @@ public class ContactDetailsDialog : Gtk.Dialog { [GtkChild] private Image qrcode_image; [GtkChild] private Popover qrcode_popover; + construct { + // If we set the strings in the .ui file, they don't get translated + title = _("OMEMO Key Management"); + automatically_accept_new_label.label = _("Automatically accept new keys"); + automatically_accept_new_descr.label = _("When this contact adds new encryption keys to their account, automatically accept them."); + own_key_label.label = _("Own key"); + new_keys_label.label = _("New keys"); + associated_keys_label.label = _("Associated keys"); + } + public ContactDetailsDialog(Plugin plugin, Account account, Jid jid) { Object(use_header_bar : Environment.get_variable("GTK_CSD") != "0" ? 1 : 0); this.plugin = plugin; -- cgit v1.2.3-54-g00ecf