[gnome-settings-daemon] wwan: Don't split strings marked for translation



commit e31b57a8d8219f6f2b3e3948a06dae93cde1845e
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date:   Mon Aug 17 16:13:02 2020 +0530

    wwan: Don't split strings marked for translation
    
    Splitting strings won't work right in many languages, and makes
    the life of translators harder.
    
    See https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/174#note_890827, #548

 plugins/wwan/cc-wwan-device.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/plugins/wwan/cc-wwan-device.c b/plugins/wwan/cc-wwan-device.c
index 7ecfee14..57b869b7 100644
--- a/plugins/wwan/cc-wwan-device.c
+++ b/plugins/wwan/cc-wwan-device.c
@@ -975,6 +975,13 @@ cc_wwan_device_get_string_from_mode (CcWwanDevice *self,
   g_return_val_if_fail (CC_IS_WWAN_DEVICE (self), NULL);
   g_return_val_if_fail (allowed != 0, NULL);
 
+  if (allowed == MM_MODEM_MODE_2G)
+    return g_strdup (_("2G Only"));
+  if (allowed == MM_MODEM_MODE_3G)
+    return g_strdup (_("3G Only"));
+  if (allowed == MM_MODEM_MODE_4G)
+    return g_strdup (_("4G Only"));
+
   str = g_string_sized_new (10);
 
   if (allowed & MM_MODEM_MODE_2G)
@@ -984,11 +991,6 @@ cc_wwan_device_get_string_from_mode (CcWwanDevice *self,
   if (allowed & MM_MODEM_MODE_4G)
     APPEND_MODE_TO_STRING (str, MM_MODEM_MODE_4G, preferred, "4G");
 
-  if (allowed == MM_MODEM_MODE_2G ||
-      allowed == MM_MODEM_MODE_3G ||
-      allowed == MM_MODEM_MODE_4G)
-    g_string_append (str, _(" Only"));
-
   if (str->len == 0)
     return g_string_free (str, TRUE);
   else


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