From f0361c71245f26f88287312a0f1d561eebc98078 Mon Sep 17 00:00:00 2001 From: Sergey Alyoshin Date: Thu, 4 Dec 2014 19:27:51 +0300 Subject: [PATCH] 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 +/* 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 -- 1.9.1