2
* Copyright (C) 2015 Canonical Ltd
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Jonas G. Drange <jonas.drange@canonical.com>
24
The mapping of code to string is taken from
25
http://bazaar.launchpad.net/~vcs-imports/
26
network-manager/trunk/view/head:/cli/src/common.c
28
NetworkManager documentation: https://developer.gnome.org/
29
NetworkManager/0.9/spec.html#type-NM_DEVICE_STATE_REASON
31
function reasonToString (reason) {
34
return i18n.tr("Unknown error");
36
return i18n.tr("No reason given");
38
return i18n.tr("Device is now managed");
40
return i18n.tr("Device is now unmanaged");
42
return i18n.tr("The device could not be readied for configuration");
44
return i18n.tr("IP configuration could not be reserved (no available address, timeout, etc.)");
46
return i18n.tr("The IP configuration is no longer valid");
48
return i18n.tr("Your authentication details were incorrect");
50
return i18n.tr("802.1X supplicant disconnected");
52
return i18n.tr("802.1X supplicant configuration failed");
54
return i18n.tr("802.1X supplicant failed");
56
return i18n.tr("802.1X supplicant took too long to authenticate");
58
return i18n.tr("DHCP client failed to start");
60
return i18n.tr("DHCP client error");
62
return i18n.tr("DHCP client failed");
64
return i18n.tr("Shared connection service failed to start");
66
return i18n.tr("Shared connection service failed");
68
return i18n.tr("Necessary firmware for the device may be missing");
70
return i18n.tr("The device was removed");
72
return i18n.tr("NetworkManager went to sleep");
74
return i18n.tr("The device's active connection disappeared");
76
return i18n.tr("Device disconnected by user or client");
78
return i18n.tr("The device's existing connection was assumed");
80
return i18n.tr("The supplicant is now available");
82
return i18n.tr("The modem could not be found");
84
return i18n.tr("The Bluetooth connection failed or timed out");
86
return i18n.tr("A dependency of the connection failed");
88
return i18n.tr("ModemManager is unavailable");
90
return i18n.tr("The Wi-Fi network could not be found");
92
return i18n.tr("A secondary connection of the base connection failed");
94
return i18n.tr("Unknown");