diff options
author | Thomas Haller <thaller@redhat.com> | 2019-10-01 16:17:48 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-10-02 18:17:21 +0200 |
commit | 10e8f7fdb442db8f0fecf43fef8545e24367ebd5 (patch) | |
tree | 523fa7832509734886a67e20f89ee49cf39f4aec | |
parent | 3b69f02164d20258720b6a06d98a07c0c710e219 (diff) | |
download | NetworkManager-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.c | 19 |
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); |