summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-10-01 16:17:48 +0200
committerThomas Haller <thaller@redhat.com>2019-10-02 18:17:21 +0200
commit10e8f7fdb442db8f0fecf43fef8545e24367ebd5 (patch)
tree523fa7832509734886a67e20f89ee49cf39f4aec
parent3b69f02164d20258720b6a06d98a07c0c710e219 (diff)
downloadNetworkManager-10e8f7fdb442db8f0fecf43fef8545e24367ebd5.tar.gz
cli: translate overview output of nmcli
Note the "to" in the output: $ LANG=de_DE.UTF-8 nmcli eth0: verbunden to Wired Connection 1 "Intel Ethernet" ... https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/246
-rw-r--r--clients/cli/general.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/clients/cli/general.c b/clients/cli/general.c
index 338deec21a..e246d2828d 100644
--- a/clients/cli/general.c
+++ b/clients/cli/general.c
@@ -1414,11 +1414,20 @@ do_overview (NmCli *nmc, int argc, char **argv)
state = nm_device_get_state (devices[i]);
color = nmc_device_state_to_color (state);
- tmp = nmc_colorize (&nmc->nmc_config, color, "%s: %s%s%s",
- nm_device_get_iface (devices[i]),
- gettext (nmc_device_state_to_string (state)),
- ac ? " to " : "",
- ac ? nm_active_connection_get_id (ac) : "");
+ if (ac) {
+ /* TRANSLATORS: prints header line for activated device in plain `nmcli` overview output as
+ * "<interface-name>: <device-state> to <connection-id>" */
+ tmp = nmc_colorize (&nmc->nmc_config, color, C_("nmcli-overview", "%s: %s to %s"),
+ nm_device_get_iface (devices[i]),
+ gettext (nmc_device_state_to_string (state)),
+ nm_active_connection_get_id (ac));
+ } else {
+ /* TRANSLATORS: prints header line for not active device in plain `nmcli` overview output as
+ * "<interface-name>: <device-state>" */
+ tmp = nmc_colorize (&nmc->nmc_config, color, C_("nmcli-overview", "%s: %s"),
+ nm_device_get_iface (devices[i]),
+ gettext (nmc_device_state_to_string (state)));
+ }
g_print ("%s\n", tmp);
g_free (tmp);