[Xfce4-commits] [panel-plugins/xfce4-wavelan-plugin] 01/01: Add strings to translation

noreply at xfce.org noreply at xfce.org
Thu Dec 4 17:58:18 CET 2014


This is an automated email from the git hooks/post-receive script.

landry pushed a commit to branch master
in repository panel-plugins/xfce4-wavelan-plugin.

commit 4aedc49e96c6cba42a05ac3b77526697b5e3dad1
Author: Sergey Alyoshin <alyoshin.s at gmail.com>
Date:   Thu Dec 4 19:27:51 2014 +0300

    Add strings to translation
---
 panel-plugin/wavelan.c   |    8 +++++---
 panel-plugin/wi_common.c |   11 +++++++----
 panel-plugin/wi_linux.c  |    2 +-
 po/POTFILES.in           |    1 +
 4 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/panel-plugin/wavelan.c b/panel-plugin/wavelan.c
index 1a4e3d6..298093d 100644
--- a/panel-plugin/wavelan.c
+++ b/panel-plugin/wavelan.c
@@ -161,7 +161,7 @@ wavelan_timer(gpointer data)
       }
       else {
         /* set error */
-        tip = g_strdup(wi_strerror(result));
+        tip = g_strdup(_(wi_strerror(result)));
         wavelan_set_state(wavelan, -1);
       }
     }
@@ -169,9 +169,11 @@ wavelan_timer(gpointer data)
       wavelan_set_state(wavelan, stats.ws_quality);
 
       if (strlen(stats.ws_netname) > 0)
-        tip = g_strdup_printf("%s: %d%s at %dMb/s", stats.ws_netname, stats.ws_quality, stats.ws_qunit, stats.ws_rate);
+        /* Translators: net_name: quality quality_unit at rate Mb/s*/
+        tip = g_strdup_printf(_("%s: %d%s at %dMb/s"), stats.ws_netname, stats.ws_quality, stats.ws_qunit, stats.ws_rate);
       else
-        tip = g_strdup_printf("%d%s at %dMb/s", stats.ws_quality, stats.ws_qunit, stats.ws_rate);
+        /* Translators: quality quality_unit at rate Mb/s*/
+        tip = g_strdup_printf(_("%d%s at %dMb/s"), stats.ws_quality, stats.ws_qunit, stats.ws_rate);
     }
   }
   else {
diff --git a/panel-plugin/wi_common.c b/panel-plugin/wi_common.c
index b040393..e59bb91 100644
--- a/panel-plugin/wi_common.c
+++ b/panel-plugin/wi_common.c
@@ -24,20 +24,23 @@
 
 #include <wi.h>
 
+/* Trick to mark strings for translation */
+#define N_(str) (str)
+
 const char *
 wi_strerror(int error)
 {
   switch (error) {
   case WI_NOCARRIER:
-    return("No carrier signal");
+    return N_("No carrier signal");
 
   case WI_NOSUCHDEV:
-    return("No such WaveLAN device");
+    return N_("No such WaveLAN device");
 
   case WI_INVAL:
-    return("Invalid parameter");
+    return N_("Invalid parameter");
 
   default:
-    return("Unknown error");
+    return N_("Unknown error");
   }
 }
diff --git a/panel-plugin/wi_linux.c b/panel-plugin/wi_linux.c
index e4ce838..c16d6ab 100644
--- a/panel-plugin/wi_linux.c
+++ b/panel-plugin/wi_linux.c
@@ -147,7 +147,7 @@ wi_query(struct wi_device *device, struct wi_stats *stats)
 
   /* FIXME */
   g_strlcpy(stats->ws_qunit, "%", 2);
-  g_strlcpy(stats->ws_vendor, "Unknown", WI_MAXSTRLEN);
+  g_strlcpy(stats->ws_vendor, _("Unknown"), WI_MAXSTRLEN);
 
   /* Set interface name */
   strncpy(wreq.ifr_name, device->interface, IFNAMSIZ);
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 197de9b..f79211b 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,2 +1,3 @@
 panel-plugin/wavelan.c
+panel-plugin/wi_common.c
 panel-plugin/wavelan.desktop.in

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list