From 4ef4776c9acd871825a9df3731a81006f7b8014d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 31 Oct 2009 21:09:02 +0000 Subject: all: various i18n realted fixes --- libs/core/luasrc/model/network/wireless.lua | 10 ++++---- libs/core/luasrc/model/wireless.lua | 36 ++++++++++++++--------------- 2 files changed, 24 insertions(+), 22 deletions(-) (limited to 'libs/core') diff --git a/libs/core/luasrc/model/network/wireless.lua b/libs/core/luasrc/model/network/wireless.lua index 122532523..1dfc70e88 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 2a463dbad..8533fb934 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) -- cgit v1.2.3