[gnome-control-center] wifi: Set hotspot dialog title in C source



commit 82f13e848adc06948e08b3409006a93613480cab
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date:   Mon Sep 23 13:31:38 2019 +0530

    wifi: Set hotspot dialog title in C source
    
    Setting markup within UI file might be bad as some translators
    might break those markups.
    
    Setting it in C source allows to exclude the markups from being
    translated, and thus to not confuse translators.
    
    
https://gitlab.gnome.org/GNOME/gnome-control-center/commit/642be837984210b3683ccb1d6e3802854fdea02a#note_608677

 panels/network/cc-wifi-hotspot-dialog.c  | 5 +++++
 panels/network/cc-wifi-hotspot-dialog.ui | 2 --
 2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/panels/network/cc-wifi-hotspot-dialog.c b/panels/network/cc-wifi-hotspot-dialog.c
index 6f49dfa6f..2374ae156 100644
--- a/panels/network/cc-wifi-hotspot-dialog.c
+++ b/panels/network/cc-wifi-hotspot-dialog.c
@@ -447,7 +447,12 @@ cc_wifi_hotspot_dialog_class_init (CcWifiHotspotDialogClass *klass)
 static void
 cc_wifi_hotspot_dialog_init (CcWifiHotspotDialog *self)
 {
+  g_autofree gchar *title = NULL;
+
   gtk_widget_init_template (GTK_WIDGET (self));
+
+  title = g_strdup_printf ("<big><b>%s</b></big>", _("Turn On Wi-Fi Hotspot?"));
+  gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (self), title);
 }
 
 CcWifiHotspotDialog *
diff --git a/panels/network/cc-wifi-hotspot-dialog.ui b/panels/network/cc-wifi-hotspot-dialog.ui
index f062ad5ff..619e051c1 100644
--- a/panels/network/cc-wifi-hotspot-dialog.ui
+++ b/panels/network/cc-wifi-hotspot-dialog.ui
@@ -3,8 +3,6 @@
   <template class="CcWifiHotspotDialog" parent="GtkMessageDialog">
     <property name="modal">1</property>
     <property name="destroy-with-parent">1</property>
-    <property name="text" translatable="yes" comments="Translate the text only">&lt;big&gt;&lt;b&gt;Turn On 
Wi-Fi Hotspot?&lt;/b&gt;&lt;/big&gt;</property>
-    <property name="use-markup">1</property>
     <property name="message-type">other</property>
     <signal name="delete-event" handler="gtk_widget_hide_on_delete"/>
 


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