diff options
author | Thomas Haller <thaller@redhat.com> | 2017-12-21 14:36:00 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-04-13 10:11:16 +0200 |
commit | 9a675ba82ac0a22c81d5492595098af76bf39915 (patch) | |
tree | ef5e4991934f3aa4419f41ed6607b1bc9fe3e525 | |
parent | 684bf311502a0579d841bb55137f42368ae0cc6b (diff) | |
download | NetworkManager-th/various-cleanup.tar.gz |
core: don't localize strings for daemonth/various-cleanup
NetworkManager deamon does not run in the context of the
(client) user, hence it usually has no explicit locale set. Even if
a admin configures a locale for system daemons, it is not necessarily
the right locale in the client context.
Getting localization of strings right would be important. For example,
when a request fails, the error message should be in the language of
the client.
However, that is a lot of work to get right. Either the client has
to provide a localization context (so the server can generated messages
in the right language), or the client is given a method to localize
messages (e.g. by not relying on generating the message by the server,
but by generating an error code that can be looked up). It's
complicated, but just translating strings server side doesn't help.
Probably we should build libnm-core.a twice, once with l10n for libnm's
use case, and once without for the server.
The problem that the server doesn't know the l10n context is especially
bad for the name of the generated default-wired-connection, which is
something like "Wired Connection 1". See also related bug bgo#666516.
30 files changed, 162 insertions, 178 deletions
diff --git a/po/POTFILES.in b/po/POTFILES.in index d41376b5c7..3fa898413b 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -159,35 +159,3 @@ libnm/nm-vpn-plugin-old.c libnm/nm-vpn-service-plugin.c data/org.freedesktop.NetworkManager.policy.in.in shared/nm-utils/nm-shared-utils.c -src/NetworkManagerUtils.c -src/main.c -src/main-utils.c -src/dhcp/nm-dhcp-dhclient.c -src/dhcp/nm-dhcp-dhclient-utils.c -src/dhcp/nm-dhcp-manager.c -src/dns/nm-dns-manager.c -src/devices/adsl/nm-device-adsl.c -src/devices/bluetooth/nm-bluez-device.c -src/devices/bluetooth/nm-device-bt.c -src/devices/nm-device-bond.c -src/devices/nm-device-bridge.c -src/devices/nm-device-dummy.c -src/devices/nm-device-ethernet.c -src/devices/nm-device-ethernet-utils.c -src/devices/nm-device-infiniband.c -src/devices/nm-device-ip-tunnel.c -src/devices/nm-device-macvlan.c -src/devices/nm-device-tun.c -src/devices/nm-device-vlan.c -src/devices/nm-device-vxlan.c -src/devices/team/nm-device-team.c -src/devices/wifi/nm-device-olpc-mesh.c -src/devices/wifi/nm-device-wifi.c -src/devices/wifi/nm-wifi-utils.c -src/devices/wwan/nm-modem-broadband.c -src/nm-config.c -src/nm-iface-helper.c -src/nm-logging.c -src/nm-manager.c -src/settings/plugins/ibft/nms-ibft-plugin.c -src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c diff --git a/shared/nm-default.h b/shared/nm-default.h index b9be4768cf..5987b2d35e 100644 --- a/shared/nm-default.h +++ b/shared/nm-default.h @@ -72,7 +72,6 @@ #define NM_NETWORKMANAGER_COMPILATION_DAEMON ( 0 \ | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB \ - | NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG \ | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE \ | NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL \ | NM_NETWORKMANAGER_COMPILATION_WITH_DAEMON \ diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index b208ffc65f..85596f2f1b 100644 --- a/src/NetworkManagerUtils.c +++ b/src/NetworkManagerUtils.c @@ -110,11 +110,7 @@ get_new_connection_name (NMConnection *const*existing_connections, for (i = 1; TRUE; i++) { char *temp; - /* TRANSLATORS: the first %s is a prefix for the connection id, such - * as "Wired Connection" or "VPN Connection". The %d is a number - * that is combined with the first argument to create a unique - * connection id. */ - temp = g_strdup_printf (C_("connection id fallback", "%s %u"), + temp = g_strdup_printf ("%s %u", fallback_prefix, i); if (nm_utils_strv_find_first ((char **) existing_names, diff --git a/src/devices/adsl/nm-device-adsl.c b/src/devices/adsl/nm-device-adsl.c index 9133137682..0f150f901a 100644 --- a/src/devices/adsl/nm-device-adsl.c +++ b/src/devices/adsl/nm-device-adsl.c @@ -132,7 +132,7 @@ complete_connection (NMDevice *device, NM_SETTING_ADSL_SETTING_NAME, existing_connections, NULL, - _("ADSL connection"), + "ADSL connection", NULL, FALSE); /* No IPv6 yet by default */ return TRUE; diff --git a/src/devices/bluetooth/nm-bluez-device.c b/src/devices/bluetooth/nm-bluez-device.c index bd3cf18a67..593d7ce557 100644 --- a/src/devices/bluetooth/nm-bluez-device.c +++ b/src/devices/bluetooth/nm-bluez-device.c @@ -208,7 +208,7 @@ pan_connection_check_create (NMBluezDevice *self) /* Setting: Connection */ nm_utils_uuid_generate_buf (uuid); - id = g_strdup_printf (_("%s Network"), priv->name); + id = g_strdup_printf ("%s Network", priv->name); setting = nm_setting_connection_new (); g_object_set (setting, NM_SETTING_CONNECTION_ID, id, diff --git a/src/devices/bluetooth/nm-device-bt.c b/src/devices/bluetooth/nm-device-bt.c index 1d237d9277..abaf20a79f 100644 --- a/src/devices/bluetooth/nm-device-bt.c +++ b/src/devices/bluetooth/nm-device-bt.c @@ -259,7 +259,7 @@ complete_connection (NMDevice *device, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("PAN requested, but Bluetooth device does not support NAP")); + "PAN requested, but Bluetooth device does not support NAP"); g_prefix_error (error, "%s.%s: ", NM_SETTING_BLUETOOTH_SETTING_NAME, NM_SETTING_BLUETOOTH_TYPE); return FALSE; } @@ -269,7 +269,7 @@ complete_connection (NMDevice *device, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING, - _("PAN connections cannot specify GSM, CDMA, or serial settings")); + "PAN connections cannot specify GSM, CDMA, or serial settings"); g_prefix_error (error, "%s: ", s_gsm ? NM_SETTING_GSM_SETTING_NAME : s_cdma ? NM_SETTING_CDMA_SETTING_NAME : @@ -282,14 +282,14 @@ complete_connection (NMDevice *device, NM_SETTING_BLUETOOTH_TYPE, NM_SETTING_BLUETOOTH_TYPE_PANU, NULL); - fallback_prefix = _("PAN connection"); + fallback_prefix = "PAN connection"; } else if (is_dun) { /* Make sure the device supports PAN */ if (!(priv->capabilities & NM_BT_CAPABILITY_DUN)) { g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("DUN requested, but Bluetooth device does not support DUN")); + "DUN requested, but Bluetooth device does not support DUN"); g_prefix_error (error, "%s.%s: ", NM_SETTING_BLUETOOTH_SETTING_NAME, NM_SETTING_BLUETOOTH_TYPE); return FALSE; } @@ -299,7 +299,7 @@ complete_connection (NMDevice *device, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING, - _("DUN connection must include a GSM or CDMA setting")); + "DUN connection must include a GSM or CDMA setting"); g_prefix_error (error, "%s: ", NM_SETTING_BLUETOOTH_SETTING_NAME); return FALSE; } @@ -309,11 +309,11 @@ complete_connection (NMDevice *device, NULL); if (s_gsm) { - fallback_prefix = _("GSM connection"); + fallback_prefix = "GSM connection"; if (!nm_setting_gsm_get_number (s_gsm)) g_object_set (G_OBJECT (s_gsm), NM_SETTING_GSM_NUMBER, "*99#", NULL); } else { - fallback_prefix = _("CDMA connection"); + fallback_prefix = "CDMA connection"; if (!nm_setting_cdma_get_number (s_cdma)) g_object_set (G_OBJECT (s_cdma), NM_SETTING_GSM_NUMBER, "#777", NULL); } @@ -321,7 +321,7 @@ complete_connection (NMDevice *device, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("Unknown/unhandled Bluetooth connection type")); + "Unknown/unhandled Bluetooth connection type"); g_prefix_error (error, "%s.%s: ", NM_SETTING_BLUETOOTH_SETTING_NAME, NM_SETTING_BLUETOOTH_TYPE); return FALSE; } @@ -342,7 +342,7 @@ complete_connection (NMDevice *device, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("connection does not match device")); + "connection does not match device"); g_prefix_error (error, "%s.%s: ", NM_SETTING_BLUETOOTH_SETTING_NAME, NM_SETTING_BLUETOOTH_BDADDR); return FALSE; } diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c index 2dd9494a8b..d6136c0506 100644 --- a/src/devices/nm-device-bond.c +++ b/src/devices/nm-device-bond.c @@ -86,7 +86,7 @@ complete_connection (NMDevice *device, NM_SETTING_BOND_SETTING_NAME, existing_connections, NULL, - _("Bond connection"), + "Bond connection", "bond", TRUE); diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c index c81a025338..39559f2bce 100644 --- a/src/devices/nm-device-bridge.c +++ b/src/devices/nm-device-bridge.c @@ -125,7 +125,7 @@ complete_connection (NMDevice *device, NM_SETTING_BRIDGE_SETTING_NAME, existing_connections, NULL, - _("Bridge connection"), + "Bridge connection", "bridge", TRUE); diff --git a/src/devices/nm-device-dummy.c b/src/devices/nm-device-dummy.c index f8bc8e7521..6606ce2216 100644 --- a/src/devices/nm-device-dummy.c +++ b/src/devices/nm-device-dummy.c @@ -65,7 +65,7 @@ complete_connection (NMDevice *device, NM_SETTING_DUMMY_SETTING_NAME, existing_connections, NULL, - _("Dummy connection"), + "Dummy connection", NULL, TRUE); diff --git a/src/devices/nm-device-ethernet-utils.c b/src/devices/nm-device-ethernet-utils.c index 298e6dff95..8decbff074 100644 --- a/src/devices/nm-device-ethernet-utils.c +++ b/src/devices/nm-device-ethernet-utils.c @@ -32,6 +32,7 @@ nm_device_ethernet_utils_get_default_wired_name (NMConnection *const *connection int i; /* Find the next available unique connection name */ +<<<<<<< HEAD for (i = 1; i <= 10000; i++) { temp = g_strdup_printf (_("Wired connection %d"), i); for (j = 0; connections[j]; j++) { @@ -39,6 +40,25 @@ nm_device_ethernet_utils_get_default_wired_name (NMConnection *const *connection g_free (temp); goto next; } +||||||| merged common ancestors + for (i = 1; TRUE; i++) { + char *temp; + + temp = g_strdup_printf (_("Wired connection %u"), i); + if ( name_idx + && g_hash_table_contains (name_idx, temp)) { + g_free (temp); + continue; +======= + for (i = 1; TRUE; i++) { + char *temp; + + temp = g_strdup_printf ("Wired connection %u", i); + if ( name_idx + && g_hash_table_contains (name_idx, temp)) { + g_free (temp); + continue; +>>>>>>> core: don't localize strings for daemon } return temp; next: diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c index 56dc7f43ce..5bc37b3868 100644 --- a/src/devices/nm-device-ethernet.c +++ b/src/devices/nm-device-ethernet.c @@ -1397,7 +1397,7 @@ complete_connection (NMDevice *device, s_pppoe ? NM_SETTING_PPPOE_SETTING_NAME : NM_SETTING_WIRED_SETTING_NAME, existing_connections, NULL, - s_pppoe ? _("PPPoE connection") : _("Wired connection"), + s_pppoe ? "PPPoE connection" : "Wired connection", NULL, s_pppoe ? FALSE : TRUE); /* No IPv6 by default yet for PPPoE */ @@ -1416,7 +1416,7 @@ complete_connection (NMDevice *device, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("connection does not match device")); + "connection does not match device"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRED_SETTING_NAME, NM_SETTING_WIRED_MAC_ADDRESS); return FALSE; } diff --git a/src/devices/nm-device-infiniband.c b/src/devices/nm-device-infiniband.c index 781bbd6921..309c117ef0 100644 --- a/src/devices/nm-device-infiniband.c +++ b/src/devices/nm-device-infiniband.c @@ -187,7 +187,7 @@ complete_connection (NMDevice *device, NM_SETTING_INFINIBAND_SETTING_NAME, existing_connections, NULL, - _("InfiniBand connection"), + "InfiniBand connection", NULL, TRUE); @@ -205,7 +205,7 @@ complete_connection (NMDevice *device, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("connection does not match device")); + "connection does not match device"); g_prefix_error (error, "%s.%s: ", NM_SETTING_INFINIBAND_SETTING_NAME, NM_SETTING_INFINIBAND_MAC_ADDRESS); return FALSE; } diff --git a/src/devices/nm-device-ip-tunnel.c b/src/devices/nm-device-ip-tunnel.c index 59ca9ed557..f340fe3bc4 100644 --- a/src/devices/nm-device-ip-tunnel.c +++ b/src/devices/nm-device-ip-tunnel.c @@ -368,7 +368,7 @@ complete_connection (NMDevice *device, NM_SETTING_IP_TUNNEL_SETTING_NAME, existing_connections, NULL, - _("IP tunnel connection"), + "IP tunnel connection", NULL, TRUE); diff --git a/src/devices/nm-device-macvlan.c b/src/devices/nm-device-macvlan.c index b8e748d660..ebb83a4977 100644 --- a/src/devices/nm-device-macvlan.c +++ b/src/devices/nm-device-macvlan.c @@ -344,7 +344,7 @@ complete_connection (NMDevice *device, NM_SETTING_MACVLAN_SETTING_NAME, existing_connections, NULL, - _("MACVLAN connection"), + "MACVLAN connection", NULL, TRUE); diff --git a/src/devices/nm-device-tun.c b/src/devices/nm-device-tun.c index c3ce4b7357..280d4707c3 100644 --- a/src/devices/nm-device-tun.c +++ b/src/devices/nm-device-tun.c @@ -155,7 +155,7 @@ complete_connection (NMDevice *device, NM_SETTING_TUN_SETTING_NAME, existing_connections, NULL, - _("TUN connection"), + "TUN connection", NULL, TRUE); diff --git a/src/devices/nm-device-vlan.c b/src/devices/nm-device-vlan.c index ae6a0f3690..0bb4b9f836 100644 --- a/src/devices/nm-device-vlan.c +++ b/src/devices/nm-device-vlan.c @@ -389,7 +389,7 @@ complete_connection (NMDevice *device, NM_SETTING_VLAN_SETTING_NAME, existing_connections, NULL, - _("VLAN connection"), + "VLAN connection", NULL, TRUE); diff --git a/src/devices/nm-device-vxlan.c b/src/devices/nm-device-vxlan.c index e125222374..938ac0bfdf 100644 --- a/src/devices/nm-device-vxlan.c +++ b/src/devices/nm-device-vxlan.c @@ -324,7 +324,7 @@ complete_connection (NMDevice *device, NM_SETTING_VXLAN_SETTING_NAME, existing_connections, NULL, - _("VXLAN connection"), + "VXLAN connection", NULL, TRUE); diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c index f83ba22b5d..4461ab7176 100644 --- a/src/devices/team/nm-device-team.c +++ b/src/devices/team/nm-device-team.c @@ -114,7 +114,7 @@ complete_connection (NMDevice *device, NM_SETTING_TEAM_SETTING_NAME, existing_connections, NULL, - _("Team connection"), + "Team connection", "team", TRUE); diff --git a/src/devices/wifi/nm-device-olpc-mesh.c b/src/devices/wifi/nm-device-olpc-mesh.c index cd2c68af86..b0de2ce9d4 100644 --- a/src/devices/wifi/nm-device-olpc-mesh.c +++ b/src/devices/wifi/nm-device-olpc-mesh.c @@ -144,7 +144,7 @@ complete_connection (NMDevice *device, NM_SETTING_OLPC_MESH_SETTING_NAME, existing_connections, NULL, - _("Mesh"), + "Mesh", NULL, FALSE); /* No IPv6 by default */ diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c index de4af42cfc..3b257a0a3a 100644 --- a/src/devices/wifi/nm-device-wifi.c +++ b/src/devices/wifi/nm-device-wifi.c @@ -835,7 +835,7 @@ complete_connection (NMDevice *device, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING, - _("WPA Ad-Hoc disabled due to kernel bugs")); + "WPA Ad-Hoc disabled due to kernel bugs"); g_prefix_error (error, "%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); if (tmp_ssid) g_byte_array_unref (tmp_ssid); @@ -868,7 +868,7 @@ complete_connection (NMDevice *device, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("connection does not match device")); + "connection does not match device"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_MAC_ADDRESS); return FALSE; } diff --git a/src/devices/wifi/nm-wifi-utils.c b/src/devices/wifi/nm-wifi-utils.c index 044bd392dd..9e2913f8da 100644 --- a/src/devices/wifi/nm-wifi-utils.c +++ b/src/devices/wifi/nm-wifi-utils.c @@ -40,7 +40,7 @@ verify_no_wep (NMSettingWirelessSecurity *s_wsec, const char *tag, GError **erro g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING, - _("%s is incompatible with static WEP keys"), tag); + "%s is incompatible with static WEP keys", tag); g_prefix_error (error, "%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); return FALSE; } @@ -74,7 +74,7 @@ verify_leap (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_MISSING_PROPERTY, - _("LEAP authentication requires a LEAP username")); + "LEAP authentication requires a LEAP username"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME); return FALSE; @@ -84,7 +84,7 @@ verify_leap (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("LEAP username requires 'leap' authentication")); + "LEAP username requires 'leap' authentication"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME); return FALSE; @@ -97,7 +97,7 @@ verify_leap (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("LEAP authentication requires IEEE 802.1x key management")); + "LEAP authentication requires IEEE 802.1x key management"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); return FALSE; @@ -117,7 +117,7 @@ verify_leap (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING, - _("LEAP authentication is incompatible with Ad-Hoc mode")); + "LEAP authentication is incompatible with Ad-Hoc mode"); g_prefix_error (error, "%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); return FALSE; } @@ -129,7 +129,7 @@ verify_leap (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING, - _("LEAP authentication is incompatible with 802.1x setting")); + "LEAP authentication is incompatible with 802.1x setting"); g_prefix_error (error, "%s: ", NM_SETTING_802_1X_SETTING_NAME); return FALSE; } @@ -151,7 +151,7 @@ verify_no_wpa (NMSettingWirelessSecurity *s_wsec, g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("a connection using '%s' authentication cannot use WPA key management"), + "a connection using '%s' authentication cannot use WPA key management", tag); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); @@ -162,7 +162,7 @@ verify_no_wpa (NMSettingWirelessSecurity *s_wsec, g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("a connection using '%s' authentication cannot specify WPA protocols"), + "a connection using '%s' authentication cannot specify WPA protocols", tag); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_PROTO); @@ -178,7 +178,7 @@ verify_no_wpa (NMSettingWirelessSecurity *s_wsec, g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("a connection using '%s' authentication cannot specify WPA ciphers"), + "a connection using '%s' authentication cannot specify WPA ciphers", tag); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_PAIRWISE); @@ -195,7 +195,7 @@ verify_no_wpa (NMSettingWirelessSecurity *s_wsec, g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("a connection using '%s' authentication cannot specify WPA ciphers"), + "a connection using '%s' authentication cannot specify WPA ciphers", tag); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_GROUP); @@ -207,7 +207,7 @@ verify_no_wpa (NMSettingWirelessSecurity *s_wsec, g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("a connection using '%s' authentication cannot specify a WPA password"), + "a connection using '%s' authentication cannot specify a WPA password", tag); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_PSK); @@ -238,7 +238,7 @@ verify_dynamic_wep (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_MISSING_SETTING, - _("Dynamic WEP requires an 802.1x setting")); + "Dynamic WEP requires an 802.1x setting"); g_prefix_error (error, "%s: ", NM_SETTING_802_1X_SETTING_NAME); return FALSE; } @@ -248,7 +248,7 @@ verify_dynamic_wep (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("Dynamic WEP requires 'open' authentication")); + "Dynamic WEP requires 'open' authentication"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_AUTH_ALG); return FALSE; @@ -263,7 +263,7 @@ verify_dynamic_wep (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("Dynamic WEP requires 'ieee8021x' key management")); + "Dynamic WEP requires 'ieee8021x' key management"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); return FALSE; @@ -276,7 +276,7 @@ verify_dynamic_wep (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("Dynamic WEP requires 'open' authentication")); + "Dynamic WEP requires 'open' authentication"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_AUTH_ALG); return FALSE; @@ -310,7 +310,7 @@ verify_wpa_psk (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING, - _("WPA-PSK authentication is incompatible with 802.1x")); + "WPA-PSK authentication is incompatible with 802.1x"); g_prefix_error (error, "%s: ", NM_SETTING_802_1X_SETTING_NAME); return FALSE; } @@ -320,7 +320,7 @@ verify_wpa_psk (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("WPA-PSK requires 'open' authentication")); + "WPA-PSK requires 'open' authentication"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_AUTH_ALG); return FALSE; @@ -332,7 +332,7 @@ verify_wpa_psk (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("WPA Ad-Hoc authentication requires an Ad-Hoc mode AP")); + "WPA Ad-Hoc authentication requires an Ad-Hoc mode AP"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_MODE); return FALSE; @@ -345,7 +345,7 @@ verify_wpa_psk (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("WPA Ad-Hoc authentication requires 'wpa' protocol")); + "WPA Ad-Hoc authentication requires 'wpa' protocol"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_PROTO); return FALSE; @@ -357,7 +357,7 @@ verify_wpa_psk (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("WPA Ad-Hoc authentication requires 'none' pairwise cipher")); + "WPA Ad-Hoc authentication requires 'none' pairwise cipher"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_PAIRWISE); return FALSE; @@ -369,7 +369,7 @@ verify_wpa_psk (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("WPA Ad-Hoc requires 'tkip' group cipher")); + "WPA Ad-Hoc requires 'tkip' group cipher"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_GROUP); return FALSE; @@ -383,7 +383,7 @@ verify_wpa_psk (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("Access point does not support PSK but setting requires it")); + "Access point does not support PSK but setting requires it"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); return FALSE; @@ -413,7 +413,7 @@ verify_wpa_eap (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_MISSING_SETTING, - _("WPA-EAP authentication requires an 802.1x setting")); + "WPA-EAP authentication requires an 802.1x setting"); g_prefix_error (error, "%s: ", NM_SETTING_802_1X_SETTING_NAME); return FALSE; } @@ -423,7 +423,7 @@ verify_wpa_eap (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("WPA-EAP requires 'open' authentication")); + "WPA-EAP requires 'open' authentication"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_AUTH_ALG); return FALSE; @@ -434,7 +434,7 @@ verify_wpa_eap (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING, - _("802.1x setting requires 'wpa-eap' key management")); + "802.1x setting requires 'wpa-eap' key management"); g_prefix_error (error, "%s: ", NM_SETTING_802_1X_SETTING_NAME); return FALSE; } @@ -447,7 +447,7 @@ verify_wpa_eap (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING, - _("Access point does not support 802.1x but setting requires it")); + "Access point does not support 802.1x but setting requires it"); g_prefix_error (error, "%s: ", NM_SETTING_802_1X_SETTING_NAME); return FALSE; } @@ -475,7 +475,7 @@ verify_adhoc (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("Access point mode is Ad-Hoc but setting requires Infrastructure security")); + "Access point mode is Ad-Hoc but setting requires Infrastructure security"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); return FALSE; @@ -485,7 +485,7 @@ verify_adhoc (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING, - _("Ad-Hoc mode is incompatible with 802.1x security")); + "Ad-Hoc mode is incompatible with 802.1x security"); g_prefix_error (error, "%s: ", NM_SETTING_802_1X_SETTING_NAME); return FALSE; } @@ -494,7 +494,7 @@ verify_adhoc (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("Ad-Hoc mode is incompatible with LEAP security")); + "Ad-Hoc mode is incompatible with LEAP security"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_AUTH_ALG); return FALSE; @@ -504,7 +504,7 @@ verify_adhoc (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("Ad-Hoc mode requires 'open' authentication")); + "Ad-Hoc mode requires 'open' authentication"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_AUTH_ALG); return FALSE; @@ -514,7 +514,7 @@ verify_adhoc (NMSettingWirelessSecurity *s_wsec, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("Access point mode is Infrastructure but setting requires Ad-Hoc security")); + "Access point mode is Infrastructure but setting requires Ad-Hoc security"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); return FALSE; @@ -556,7 +556,7 @@ nm_wifi_utils_complete_connection (const GByteArray *ap_ssid, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("connection does not match access point")); + "connection does not match access point"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_SSID); g_bytes_unref (ap_ssid_bytes); return FALSE; @@ -586,7 +586,7 @@ nm_wifi_utils_complete_connection (const GByteArray *ap_ssid, g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("connection does not match access point")); + "connection does not match access point"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_MODE); return FALSE; } @@ -610,7 +610,7 @@ nm_wifi_utils_complete_connection (const GByteArray *ap_ssid, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_SETTING, - _("Access point is unencrypted but setting specifies security")); + "Access point is unencrypted but setting specifies security"); if (s_wsec) g_prefix_error (error, "%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME); else @@ -699,7 +699,7 @@ nm_wifi_utils_complete_connection (const GByteArray *ap_ssid, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("WPA authentication is incompatible with non-EAP (original) LEAP or Dynamic WEP")); + "WPA authentication is incompatible with non-EAP (original) LEAP or Dynamic WEP"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT); return FALSE; } @@ -709,7 +709,7 @@ nm_wifi_utils_complete_connection (const GByteArray *ap_ssid, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("WPA authentication is incompatible with Shared Key authentication")); + "WPA authentication is incompatible with Shared Key authentication"); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_AUTH_ALG); return FALSE; } @@ -756,7 +756,7 @@ nm_wifi_utils_complete_connection (const GByteArray *ap_ssid, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_FAILED, - _("Failed to determine AP security information")); + "Failed to determine AP security information"); return FALSE; } diff --git a/src/devices/wwan/nm-modem-broadband.c b/src/devices/wwan/nm-modem-broadband.c index 9a3744db3c..1dd8dde693 100644 --- a/src/devices/wwan/nm-modem-broadband.c +++ b/src/devices/wwan/nm-modem-broadband.c @@ -692,7 +692,7 @@ complete_connection (NMModem *_self, g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_MISSING_SETTING, - _("GSM mobile broadband connection requires a 'gsm' setting")); + "GSM mobile broadband connection requires a 'gsm' setting"); g_prefix_error (error, "%s: ", NM_SETTING_GSM_SETTING_NAME); return FALSE; } @@ -706,7 +706,7 @@ complete_connection (NMModem *_self, NM_SETTING_GSM_SETTING_NAME, existing_connections, NULL, - _("GSM connection"), + "GSM connection", NULL, FALSE); /* No IPv6 yet by default */ @@ -730,7 +730,7 @@ complete_connection (NMModem *_self, NM_SETTING_CDMA_SETTING_NAME, existing_connections, NULL, - _("CDMA connection"), + "CDMA connection", NULL, FALSE); /* No IPv6 yet by default */ diff --git a/src/dhcp/nm-dhcp-dhclient-utils.c b/src/dhcp/nm-dhcp-dhclient-utils.c index 52923310b8..b14899ad47 100644 --- a/src/dhcp/nm-dhcp-dhclient-utils.c +++ b/src/dhcp/nm-dhcp-dhclient-utils.c @@ -311,7 +311,7 @@ nm_dhcp_dhclient_create_config (const char *interface, g_return_val_if_fail (NM_IN_SET (addr_family, AF_INET, AF_INET6), NULL); nm_assert (!out_new_client_id || !*out_new_client_id); - new_contents = g_string_new (_("# Created by NetworkManager\n")); + new_contents = g_string_new ("# Created by NetworkManager\n"); fqdn_opts = g_ptr_array_sized_new (5); reqs = g_ptr_array_new_full (5, g_free); @@ -321,7 +321,7 @@ nm_dhcp_dhclient_create_config (const char *interface, gboolean in_req = FALSE; char intf[IFNAMSIZ]; - g_string_append_printf (new_contents, _("# Merged from %s\n\n"), orig_path); + g_string_append_printf (new_contents, "# Merged from %s\n\n", orig_path); intf[0] = '\0'; lines = g_strsplit_set (orig_contents, "\n\r", 0); diff --git a/src/main-utils.c b/src/main-utils.c index 0f79053607..7133531ea2 100644 --- a/src/main-utils.c +++ b/src/main-utils.c @@ -28,10 +28,11 @@ #include <unistd.h> #include <sys/stat.h> #include <locale.h> - #include <glib/gstdio.h> #include <glib-unix.h> +#include <glib/gi18n.h> + #include "main-utils.h" #include "NetworkManagerUtils.h" #include "nm-config.h" @@ -96,18 +97,18 @@ nm_main_utils_write_pidfile (const char *pidfile) gboolean success = FALSE; if ((fd = open (pidfile, O_CREAT | O_WRONLY | O_TRUNC | O_CLOEXEC, 00644)) < 0) { - fprintf (stderr, _("Opening %s failed: %s\n"), pidfile, strerror (errno)); + fprintf (stderr, "Opening %s failed: %s\n", pidfile, strerror (errno)); return FALSE; } g_snprintf (pid, sizeof (pid), "%d", getpid ()); if (write (fd, pid, strlen (pid)) < 0) - fprintf (stderr, _("Writing to %s failed: %s\n"), pidfile, strerror (errno)); + fprintf (stderr, "Writing to %s failed: %s\n", pidfile, strerror (errno)); else success = TRUE; if (nm_close (fd)) - fprintf (stderr, _("Closing %s failed: %s\n"), pidfile, strerror (errno)); + fprintf (stderr, "Closing %s failed: %s\n", pidfile, strerror (errno)); return success; } @@ -145,7 +146,7 @@ nm_main_utils_ensure_rundir () /* Setup runtime directory */ if (g_mkdir_with_parents (NMRUNDIR, 0755) != 0) { errsv = errno; - fprintf (stderr, _("Cannot create '%s': %s"), NMRUNDIR, g_strerror (errsv)); + fprintf (stderr, "Cannot create '%s': %s", NMRUNDIR, g_strerror (errsv)); exit (1); } @@ -156,7 +157,7 @@ nm_main_utils_ensure_rundir () if (g_mkdir (NM_CONFIG_DEVICE_STATE_DIR, 0755) != 0) { errsv = errno; if (errsv != EEXIST) { - fprintf (stderr, _("Cannot create '%s': %s"), NM_CONFIG_DEVICE_STATE_DIR, g_strerror (errsv)); + fprintf (stderr, "Cannot create '%s': %s", NM_CONFIG_DEVICE_STATE_DIR, g_strerror (errsv)); exit (1); } } @@ -209,7 +210,7 @@ nm_main_utils_ensure_not_running_pidfile (const char *pidfile) if (strcmp (process_name, prgname) == 0) { /* Check that the process exists */ if (kill (pid, 0) == 0) { - fprintf (stderr, _("%s is already running (pid %ld)\n"), prgname, pid); + fprintf (stderr, "%s is already running (pid %ld)\n", prgname, pid); exit (1); } } @@ -219,7 +220,7 @@ void nm_main_utils_ensure_root () { if (getuid () != 0) { - fprintf (stderr, _("You must be root to run %s!\n"), g_get_prgname () ?: ""); + fprintf (stderr, "You must be root to run %s!\n", g_get_prgname () ?: ""); exit (1); } } @@ -283,7 +284,7 @@ nm_main_utils_early_setup (const char *progname, success = g_option_context_parse (opt_ctx, argc, argv, &error); if (!success) { - fprintf (stderr, _("%s. Please use --help to see a list of valid options.\n"), + fprintf (stderr, "%s. Please use --help to see a list of valid options.\n", error->message); g_clear_error (&error); } diff --git a/src/main.c b/src/main.c index bd8e26a556..2ca28e47fc 100644 --- a/src/main.c +++ b/src/main.c @@ -178,7 +178,7 @@ print_config (NMConfigCmdLineOptions *config_cli) config = nm_config_new (config_cli, CONFIG_ATOMIC_SECTION_PREFIXES, &error); if (config == NULL) { - fprintf (stderr, _("Failed to read configuration: %s\n"), error->message); + fprintf (stderr, "Failed to read configuration: %s\n", error->message); return 7; } @@ -192,16 +192,16 @@ static void do_early_setup (int *argc, char **argv[], NMConfigCmdLineOptions *config_cli) { GOptionEntry options[] = { - { "version", 'V', 0, G_OPTION_ARG_NONE, &global_opt.show_version, N_("Print NetworkManager version and exit"), NULL }, - { "no-daemon", 'n', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &global_opt.become_daemon, N_("Don't become a daemon"), NULL }, - { "log-level", 0, 0, G_OPTION_ARG_STRING, &global_opt.opt_log_level, N_("Log level: one of [%s]"), "INFO" }, + { "version", 'V', 0, G_OPTION_ARG_NONE, &global_opt.show_version, "Print NetworkManager version and exit", NULL }, + { "no-daemon", 'n', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &global_opt.become_daemon, "Don't become a daemon", NULL }, + { "log-level", 0, 0, G_OPTION_ARG_STRING, &global_opt.opt_log_level, "Log level: one of [%s]", "INFO" }, { "log-domains", 0, 0, G_OPTION_ARG_STRING, &global_opt.opt_log_domains, - N_("Log domains separated by ',': any combination of [%s]"), + "Log domains separated by ',': any combination of [%s]", "PLATFORM,RFKILL,WIFI" }, - { "g-fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &global_opt.g_fatal_warnings, N_("Make all warnings fatal"), NULL }, - { "pid-file", 'p', 0, G_OPTION_ARG_FILENAME, &global_opt.pidfile, N_("Specify the location of a PID file"), NM_DEFAULT_PID_FILE }, + { "g-fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &global_opt.g_fatal_warnings, "Make all warnings fatal", NULL }, + { "pid-file", 'p', 0, G_OPTION_ARG_FILENAME, &global_opt.pidfile, "Specify the location of a PID file", NM_DEFAULT_PID_FILE }, { "run-from-build-dir", 0, 0, G_OPTION_ARG_NONE, &global_opt.run_from_build_dir, "Run from build directory", NULL }, - { "print-config", 0, 0, G_OPTION_ARG_NONE, &global_opt.print_config, N_("Print NetworkManager configuration and exit"), NULL }, + { "print-config", 0, 0, G_OPTION_ARG_NONE, &global_opt.print_config, "Print NetworkManager configuration and exit", NULL }, {NULL} }; @@ -211,7 +211,7 @@ do_early_setup (int *argc, char **argv[], NMConfigCmdLineOptions *config_cli) options, (void (*)(gpointer, GOptionContext *)) nm_config_cmd_line_options_add_to_entries, config_cli, - _("NetworkManager monitors all network connections and automatically\nchooses the best connection to use. It also allows the user to\nspecify wireless access points which wireless cards in the computer\nshould associate with."))) + "NetworkManager monitors all network connections and automatically\nchooses the best connection to use. It also allows the user to\nspecify wireless access points which wireless cards in the computer\nshould associate with.")) exit (1); global_opt.pidfile = global_opt.pidfile ? global_opt.pidfile : g_strdup (NM_DEFAULT_PID_FILE); @@ -301,12 +301,12 @@ main (int argc, char *argv[]) &bad_domains, &error)) { fprintf (stderr, - _("%s. Please use --help to see a list of valid options.\n"), + "%s. Please use --help to see a list of valid options.\n", error->message); exit (1); } else if (bad_domains) { fprintf (stderr, - _("Ignoring unrecognized log domain(s) '%s' passed on command line.\n"), + "Ignoring unrecognized log domain(s) '%s' passed on command line.\n", bad_domains); g_clear_pointer (&bad_domains, g_free); } @@ -316,7 +316,7 @@ main (int argc, char *argv[]) nm_config_cmd_line_options_free (config_cli); config_cli = NULL; if (config == NULL) { - fprintf (stderr, _("Failed to read configuration: %s\n"), + fprintf (stderr, "Failed to read configuration: %s\n", error->message); exit (1); } @@ -331,12 +331,12 @@ main (int argc, char *argv[]) nm_config_get_log_domains (config), &bad_domains, &error)) { - fprintf (stderr, _("Error in configuration file: %s.\n"), + fprintf (stderr, "Error in configuration file: %s.\n", error->message); exit (1); } else if (bad_domains) { fprintf (stderr, - _("Ignoring unrecognized log domain(s) '%s' from config files.\n"), + "Ignoring unrecognized log domain(s) '%s' from config files.\n", bad_domains); g_clear_pointer (&bad_domains, g_free); } @@ -347,7 +347,7 @@ main (int argc, char *argv[]) int saved_errno; saved_errno = errno; - fprintf (stderr, _("Could not daemonize: %s [error %u]\n"), + fprintf (stderr, "Could not daemonize: %s [error %u]\n", g_strerror (saved_errno), saved_errno); exit (1); diff --git a/src/nm-config.c b/src/nm-config.c index ab839b83e7..17d5cfaa11 100644 --- a/src/nm-config.c +++ b/src/nm-config.c @@ -518,20 +518,20 @@ nm_config_cmd_line_options_add_to_entries (NMConfigCmdLineOptions *cli, { GOptionEntry config_options[] = { - { "config", 0, 0, G_OPTION_ARG_FILENAME, &cli->config_main_file, N_("Config file location"), DEFAULT_CONFIG_MAIN_FILE }, - { "config-dir", 0, 0, G_OPTION_ARG_FILENAME, &cli->config_dir, N_("Config directory location"), DEFAULT_CONFIG_DIR }, - { "system-config-dir", 0, 0, G_OPTION_ARG_FILENAME, &cli->system_config_dir, N_("System config directory location"), DEFAULT_SYSTEM_CONFIG_DIR }, - { "intern-config", 0, 0, G_OPTION_ARG_FILENAME, &cli->intern_config_file, N_("Internal config file location"), DEFAULT_INTERN_CONFIG_FILE }, - { "state-file", 0, 0, G_OPTION_ARG_FILENAME, &cli->state_file, N_("State file location"), DEFAULT_STATE_FILE }, - { "no-auto-default", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_FILENAME, &cli->no_auto_default_file, N_("State file for no-auto-default devices"), DEFAULT_NO_AUTO_DEFAULT_FILE }, - { "plugins", 0, 0, G_OPTION_ARG_STRING, &cli->plugins, N_("List of plugins separated by ','"), NM_CONFIG_DEFAULT_MAIN_PLUGINS }, - { "configure-and-quit", 0, 0, G_OPTION_ARG_NONE, &cli->configure_and_quit, N_("Quit after initial configuration"), NULL }, - { "debug", 'd', 0, G_OPTION_ARG_NONE, &cli->is_debug, N_("Don't become a daemon, and log to stderr"), NULL }, + { "config", 0, 0, G_OPTION_ARG_FILENAME, &cli->config_main_file, "Config file location", DEFAULT_CONFIG_MAIN_FILE }, + { "config-dir", 0, 0, G_OPTION_ARG_FILENAME, &cli->config_dir, "Config directory location", DEFAULT_CONFIG_DIR }, + { "system-config-dir", 0, 0, G_OPTION_ARG_FILENAME, &cli->system_config_dir, "System config directory location", DEFAULT_SYSTEM_CONFIG_DIR }, + { "intern-config", 0, 0, G_OPTION_ARG_FILENAME, &cli->intern_config_file, "Internal config file location", DEFAULT_INTERN_CONFIG_FILE }, + { "state-file", 0, 0, G_OPTION_ARG_FILENAME, &cli->state_file, "State file location", DEFAULT_STATE_FILE }, + { "no-auto-default", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_FILENAME, &cli->no_auto_default_file, "State file for no-auto-default devices", DEFAULT_NO_AUTO_DEFAULT_FILE }, + { "plugins", 0, 0, G_OPTION_ARG_STRING, &cli->plugins, "List of plugins separated by ','", NM_CONFIG_DEFAULT_MAIN_PLUGINS }, + { "configure-and-quit", 0, 0, G_OPTION_ARG_NONE, &cli->configure_and_quit, "Quit after initial configuration", NULL }, + { "debug", 'd', 0, G_OPTION_ARG_NONE, &cli->is_debug, "Don't become a daemon, and log to stderr", NULL }, /* These three are hidden for now, and should eventually just go away. */ - { "connectivity-uri", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &cli->connectivity_uri, N_("An http(s) address for checking internet connectivity"), "http://example.com" }, - { "connectivity-interval", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_INT, &cli->connectivity_interval, N_("The interval between connectivity checks (in seconds)"), G_STRINGIFY (NM_CONFIG_DEFAULT_CONNECTIVITY_INTERVAL) }, - { "connectivity-response", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &cli->connectivity_response, N_("The expected start of the response"), NM_CONFIG_DEFAULT_CONNECTIVITY_RESPONSE }, + { "connectivity-uri", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &cli->connectivity_uri, "An http(s) address for checking internet connectivity", "http://example.com" }, + { "connectivity-interval", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_INT, &cli->connectivity_interval, "The interval between connectivity checks (in seconds)", G_STRINGIFY (NM_CONFIG_DEFAULT_CONNECTIVITY_INTERVAL) }, + { "connectivity-response", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &cli->connectivity_response, "The expected start of the response", NM_CONFIG_DEFAULT_CONNECTIVITY_RESPONSE }, { 0 }, }; diff --git a/src/nm-iface-helper.c b/src/nm-iface-helper.c index 601c72acac..88e4dba125 100644 --- a/src/nm-iface-helper.c +++ b/src/nm-iface-helper.c @@ -276,32 +276,32 @@ do_early_setup (int *argc, char **argv[]) gint64 priority64_v6 = -1; GOptionEntry options[] = { /* Interface/IP config */ - { "ifname", 'i', 0, G_OPTION_ARG_STRING, &global_opt.ifname, N_("The interface to manage"), "eth0" }, - { "uuid", 'u', 0, G_OPTION_ARG_STRING, &global_opt.uuid, N_("Connection UUID"), "661e8cd0-b618-46b8-9dc9-31a52baaa16b" }, - { "stable-id", '\0', 0, G_OPTION_ARG_STRING, &global_opt.stable_id, N_("Connection Token for Stable IDs"), "eth" }, - { "slaac", 's', 0, G_OPTION_ARG_NONE, &global_opt.slaac, N_("Whether to manage IPv6 SLAAC"), NULL }, - { "slaac-required", '6', 0, G_OPTION_ARG_NONE, &global_opt.slaac_required, N_("Whether SLAAC must be successful"), NULL }, - { "slaac-tempaddr", 't', 0, G_OPTION_ARG_INT, &global_opt.tempaddr, N_("Use an IPv6 temporary privacy address"), NULL }, - { "dhcp4", 'd', 0, G_OPTION_ARG_STRING, &global_opt.dhcp4_address, N_("Current DHCPv4 address"), NULL }, - { "dhcp4-required", '4', 0, G_OPTION_ARG_NONE, &global_opt.dhcp4_required, N_("Whether DHCPv4 must be successful"), NULL }, - { "dhcp4-clientid", 'c', 0, G_OPTION_ARG_STRING, &global_opt.dhcp4_clientid, N_("Hex-encoded DHCPv4 client ID"), NULL }, - { "dhcp4-hostname", 'h', 0, G_OPTION_ARG_STRING, &global_opt.dhcp4_hostname, N_("Hostname to send to DHCP server"), N_("barbar") }, - { "dhcp4-fqdn", 'F', 0, G_OPTION_ARG_STRING, &global_opt.dhcp4_fqdn, N_("FQDN to send to DHCP server"), N_("host.domain.org") }, - { "priority4", '\0', 0, G_OPTION_ARG_INT64, &priority64_v4, N_("Route priority for IPv4"), N_("0") }, - { "priority6", '\0', 0, G_OPTION_ARG_INT64, &priority64_v6, N_("Route priority for IPv6"), N_("1024") }, - { "iid", 'e', 0, G_OPTION_ARG_STRING, &global_opt.iid_str, N_("Hex-encoded Interface Identifier"), "" }, - { "addr-gen-mode", 'e', 0, G_OPTION_ARG_INT, &global_opt.addr_gen_mode, N_("IPv6 SLAAC address generation mode"), "eui64" }, - { "logging-backend", '\0', 0, G_OPTION_ARG_STRING, &global_opt.logging_backend, N_("The logging backend configuration value. See logging.backend in NetworkManager.conf"), NULL }, + { "ifname", 'i', 0, G_OPTION_ARG_STRING, &global_opt.ifname, "The interface to manage", "eth0" }, + { "uuid", 'u', 0, G_OPTION_ARG_STRING, &global_opt.uuid, "Connection UUID", "661e8cd0-b618-46b8-9dc9-31a52baaa16b" }, + { "stable-id", '\0', 0, G_OPTION_ARG_STRING, &global_opt.stable_id, "Connection Token for Stable IDs", "eth" }, + { "slaac", 's', 0, G_OPTION_ARG_NONE, &global_opt.slaac, "Whether to manage IPv6 SLAAC", NULL }, + { "slaac-required", '6', 0, G_OPTION_ARG_NONE, &global_opt.slaac_required, "Whether SLAAC must be successful", NULL }, + { "slaac-tempaddr", 't', 0, G_OPTION_ARG_INT, &global_opt.tempaddr, "Use an IPv6 temporary privacy address", NULL }, + { "dhcp4", 'd', 0, G_OPTION_ARG_STRING, &global_opt.dhcp4_address, "Current DHCPv4 address", NULL }, + { "dhcp4-required", '4', 0, G_OPTION_ARG_NONE, &global_opt.dhcp4_required, "Whether DHCPv4 must be successful", NULL }, + { "dhcp4-clientid", 'c', 0, G_OPTION_ARG_STRING, &global_opt.dhcp4_clientid, "Hex-encoded DHCPv4 client ID", NULL }, + { "dhcp4-hostname", 'h', 0, G_OPTION_ARG_STRING, &global_opt.dhcp4_hostname, "Hostname to send to DHCP server", "barbar" }, + { "dhcp4-fqdn", 'F', 0, G_OPTION_ARG_STRING, &global_opt.dhcp4_fqdn, "FQDN to send to DHCP server", "host.domain.org" }, + { "priority4", '\0', 0, G_OPTION_ARG_INT64, &priority64_v4, "Route priority for IPv4", "0" }, + { "priority6", '\0', 0, G_OPTION_ARG_INT64, &priority64_v6, "Route priority for IPv6", "1024" }, + { "iid", 'e', 0, G_OPTION_ARG_STRING, &global_opt.iid_str, "Hex-encoded Interface Identifier", "" }, + { "addr-gen-mode", 'e', 0, G_OPTION_ARG_INT, &global_opt.addr_gen_mode, "IPv6 SLAAC address generation mode", "eui64" }, + { "logging-backend", '\0', 0, G_OPTION_ARG_STRING, &global_opt.logging_backend, "The logging backend configuration value. See logging.backend in NetworkManager.conf", NULL }, /* Logging/debugging */ - { "version", 'V', 0, G_OPTION_ARG_NONE, &global_opt.show_version, N_("Print NetworkManager version and exit"), NULL }, - { "no-daemon", 'n', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &global_opt.become_daemon, N_("Don't become a daemon"), NULL }, - { "debug", 'b', 0, G_OPTION_ARG_NONE, &global_opt.debug, N_("Don't become a daemon, and log to stderr"), NULL }, - { "log-level", 0, 0, G_OPTION_ARG_STRING, &global_opt.opt_log_level, N_("Log level: one of [%s]"), "INFO" }, + { "version", 'V', 0, G_OPTION_ARG_NONE, &global_opt.show_version, "Print NetworkManager version and exit", NULL }, + { "no-daemon", 'n', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &global_opt.become_daemon, "Don't become a daemon", NULL }, + { "debug", 'b', 0, G_OPTION_ARG_NONE, &global_opt.debug, "Don't become a daemon, and log to stderr", NULL }, + { "log-level", 0, 0, G_OPTION_ARG_STRING, &global_opt.opt_log_level, "Log level: one of [%s]", "INFO" }, { "log-domains", 0, 0, G_OPTION_ARG_STRING, &global_opt.opt_log_domains, - N_("Log domains separated by ',': any combination of [%s]"), + "Log domains separated by ',': any combination of [%s]", "PLATFORM,RFKILL,WIFI" }, - { "g-fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &global_opt.g_fatal_warnings, N_("Make all warnings fatal"), NULL }, + { "g-fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &global_opt.g_fatal_warnings, "Make all warnings fatal", NULL }, {NULL} }; @@ -311,7 +311,7 @@ do_early_setup (int *argc, char **argv[]) options, NULL, NULL, - _("nm-iface-helper is a small, standalone process that manages a single network interface."))) + "nm-iface-helper is a small, standalone process that manages a single network interface.")) return FALSE; if (priority64_v4 >= 0 && priority64_v4 <= G_MAXUINT32) @@ -419,13 +419,13 @@ main (int argc, char *argv[]) nm_main_utils_ensure_root (); if (!global_opt.ifname || !global_opt.uuid) { - fprintf (stderr, _("An interface name and UUID are required\n")); + fprintf (stderr, "An interface name and UUID are required\n"); return 1; } gl.ifindex = nmp_utils_if_nametoindex (global_opt.ifname); if (gl.ifindex <= 0) { - fprintf (stderr, _("Failed to find interface index for %s (%s)\n"), global_opt.ifname, strerror (errno)); + fprintf (stderr, "Failed to find interface index for %s (%s)\n", global_opt.ifname, strerror (errno)); return 1; } pidfile = g_strdup_printf (NMIH_PID_FILE_FMT, gl.ifindex); @@ -438,12 +438,12 @@ main (int argc, char *argv[]) &bad_domains, &error)) { fprintf (stderr, - _("%s. Please use --help to see a list of valid options.\n"), + "%s. Please use --help to see a list of valid options.\n", error->message); return 1; } else if (bad_domains) { fprintf (stderr, - _("Ignoring unrecognized log domain(s) '%s' passed on command line.\n"), + "Ignoring unrecognized log domain(s) '%s' passed on command line.\n", bad_domains); g_clear_pointer (&bad_domains, g_free); } @@ -453,7 +453,7 @@ main (int argc, char *argv[]) int saved_errno; saved_errno = errno; - fprintf (stderr, _("Could not daemonize: %s [error %u]\n"), + fprintf (stderr, "Could not daemonize: %s [error %u]\n", g_strerror (saved_errno), saved_errno); return 1; @@ -482,7 +482,7 @@ main (int argc, char *argv[]) bytes = nm_utils_hexstr2bin (global_opt.iid_str); if (!bytes || g_bytes_get_size (bytes) != sizeof (*iid)) { - fprintf (stderr, _("(%s): Invalid IID %s\n"), global_opt.ifname, global_opt.iid_str); + fprintf (stderr, "(%s): Invalid IID %s\n", global_opt.ifname, global_opt.iid_str); return 1; } iid = g_bytes_unref_to_data (bytes, &ignored); diff --git a/src/nm-logging.c b/src/nm-logging.c index 11e05c31f7..7b152dd09e 100644 --- a/src/nm-logging.c +++ b/src/nm-logging.c @@ -264,7 +264,7 @@ match_log_level (const char *level, } g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_UNKNOWN_LOG_LEVEL, - _("Unknown log level '%s'"), level); + "Unknown log level '%s'", level); return FALSE; } @@ -366,7 +366,7 @@ nm_logging_setup (const char *level, if (!bits) { if (!bad_domains) { g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_UNKNOWN_LOG_DOMAIN, - _("Unknown log domain '%s'"), *iter); + "Unknown log domain '%s'", *iter); return FALSE; } diff --git a/src/nm-manager.c b/src/nm-manager.c index 612f41562c..f3e70f9c6e 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -4659,7 +4659,7 @@ impl_manager_add_and_activate_connection (NMDBusObject *obj, NM_SETTING_VPN_SETTING_NAME, (NMConnection *const*) nm_settings_get_connections (priv->settings, NULL), NULL, - _("VPN connection"), + "VPN connection", NULL, FALSE); /* No IPv6 by default for now */ } else { diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c index 51a72d7e15..04c4970d3d 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c @@ -4578,7 +4578,7 @@ bond_connection_from_ifcfg (const char *file, connection = nm_simple_connection_new (); - con_setting = make_connection_setting (file, ifcfg, NM_SETTING_BOND_SETTING_NAME, NULL, _("Bond")); + con_setting = make_connection_setting (file, ifcfg, NM_SETTING_BOND_SETTING_NAME, NULL, "Bond"); if (!con_setting) { g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, "Failed to create connection setting."); @@ -4681,7 +4681,7 @@ team_connection_from_ifcfg (const char *file, connection = nm_simple_connection_new (); - con_setting = make_connection_setting (file, ifcfg, NM_SETTING_TEAM_SETTING_NAME, NULL, _("Team")); + con_setting = make_connection_setting (file, ifcfg, NM_SETTING_TEAM_SETTING_NAME, NULL, "Team"); if (!con_setting) { g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, "Failed to create connection setting."); @@ -4914,7 +4914,7 @@ bridge_connection_from_ifcfg (const char *file, connection = nm_simple_connection_new (); - con_setting = make_connection_setting (file, ifcfg, NM_SETTING_BRIDGE_SETTING_NAME, NULL, _("Bridge")); + con_setting = make_connection_setting (file, ifcfg, NM_SETTING_BRIDGE_SETTING_NAME, NULL, "Bridge"); if (!con_setting) { g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, "Failed to create connection setting."); |