diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-10-31 21:09:02 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-10-31 21:09:02 +0000 |
commit | 4ef4776c9acd871825a9df3731a81006f7b8014d (patch) | |
tree | d6af39531588fc61a0414cf4f7fb983ecabe371b /libs/core/luasrc | |
parent | 400831c9368bb5990da75bdff36fce9e324529f1 (diff) |
all: various i18n realted fixes
Diffstat (limited to 'libs/core/luasrc')
-rw-r--r-- | libs/core/luasrc/model/network/wireless.lua | 10 | ||||
-rw-r--r-- | libs/core/luasrc/model/wireless.lua | 36 |
2 files changed, 24 insertions, 22 deletions
diff --git a/libs/core/luasrc/model/network/wireless.lua b/libs/core/luasrc/model/network/wireless.lua index 1225325232..1dfc70e88e 100644 --- a/libs/core/luasrc/model/network/wireless.lua +++ b/libs/core/luasrc/model/network/wireless.lua @@ -66,8 +66,9 @@ end function shortname(self, iface) if iface.dev and iface.dev.wifi then return "%s %q" %{ - i18n.translate("a_s_if_iwmode_" .. (iface.dev.wifi.mode or "ap")), - iface.dev.wifi.ssid or iface.dev.wifi.bssid or "(hidden)" + i18n.translate(iface.dev.wifi.mode or "Client"), + iface.dev.wifi.ssid or iface.dev.wifi.bssid + or i18n.translate("(hidden)") } else return iface:name() @@ -78,8 +79,9 @@ function get_i18n(self, iface) if iface.dev and iface.dev.wifi then return "%s: %s %q" %{ i18n.translate("Wireless Network"), - i18n.translate("a_s_if_iwmode_" .. (iface.dev.wifi.mode or "ap"), iface.dev.wifi.mode or "AP"), - iface.dev.wifi.ssid or iface.dev.wifi.bssid or "(hidden)" + i18n.translate(iface.dev.wifi.mode or "Client"), + iface.dev.wifi.ssid or iface.dev.wifi.bssid + or i18n.translate("(hidden)") } else return "%s: %q" %{ i18n.translate("Wireless Network"), iface:name() } diff --git a/libs/core/luasrc/model/wireless.lua b/libs/core/luasrc/model/wireless.lua index 2a463dbad0..8533fb934a 100644 --- a/libs/core/luasrc/model/wireless.lua +++ b/libs/core/luasrc/model/wireless.lua @@ -89,8 +89,8 @@ end function shortname(self, iface) if iface.wdev and iface.winfo then return "%s %q" %{ - i18n.translate("a_s_if_iwmode_" .. iface:active_mode(), iface.winfo.mode(iface.wdev)), - iface:active_ssid() or "(hidden)" + i18n.translate(iface:active_mode()), + iface:active_ssid() or i18n.translate("(hidden)") } else return iface:name() @@ -101,8 +101,8 @@ function get_i18n(self, iface) if iface.wdev and iface.winfo then return "%s: %s %q (%s)" %{ i18n.translate("Wireless Network"), - i18n.translate("a_s_if_iwmode_" .. iface:active_mode(), iface.winfo.mode(iface.wdev)), - iface:active_ssid() or "(hidden)", iface.wdev + i18n.translate(iface:active_mode()), + iface:active_ssid() or i18n.translate("(hidden)"), iface.wdev } else return "%s: %q" %{ i18n.translate("Wireless Network"), iface:name() } @@ -212,12 +212,14 @@ function network._init(self, sid) count = count + 1 return s['.name'] ~= sid end) - + + local parent_dev = st:get("wireless", sid, "device") + local dev = st:get("wireless", sid, "ifname") - or st:get("wireless", sid, "device") + or parent_dev if dev then - self.id = "%s.network%d" %{ dev, count } + self.id = "%s.network%d" %{ parent_dev, count } local wtype = iwi.type(dev) if dev and wtype then @@ -247,22 +249,20 @@ end function network.active_mode(self) local m = self.winfo and self.winfo.mode(self.wdev) - if m == "Master" or m == "Auto" then - m = "ap" - elseif m == "Ad-Hoc" then - m = "adhoc" - elseif m == "Client" then - m = "sta" - elseif m then - m = m:lower() - else + if not m then m = self:mode() + if m == "ap" then m = "AP" + elseif m == "sta" then m = "Client" + elseif m == "adhoc" then m = "Ad-Hoc" + elseif m == "mesh" then m = "Mesh" + elseif m == "monitor" then m = "Monitor" + end end - return m or "ap" + return m or "Client" end function network.active_mode_i18n(self) - return i18n.translate("a_s_if_iwmode_" .. self:active_mode()) + return i18n.translate(self:active_mode()) end function network.active_ssid(self) |