all: various i18n realted fixes
This commit is contained in:
parent
400831c936
commit
4ef4776c9a
4 changed files with 35 additions and 25 deletions
|
@ -11,9 +11,16 @@ You may obtain a copy of the License at
|
|||
|
||||
$Id$
|
||||
]]--
|
||||
|
||||
local nw = require "luci.model.network"
|
||||
local fw = require "luci.model.firewall"
|
||||
|
||||
require("luci.tools.webadmin")
|
||||
m = Map("firewall", translate("Firewall"), translate("The firewall creates zones over your network interfaces to control network traffic flow."))
|
||||
|
||||
fw.init(m.uci)
|
||||
nw.init(m.uci)
|
||||
|
||||
s = m:section(TypedSection, "defaults")
|
||||
s.anonymous = true
|
||||
|
||||
|
@ -59,7 +66,8 @@ end
|
|||
s:option(Flag, "masq")
|
||||
|
||||
net = s:option(MultiValue, "network")
|
||||
net.widget = "select"
|
||||
net.template = "cbi/network_netlist"
|
||||
net.widget = "checkbox"
|
||||
net.rmempty = true
|
||||
luci.tools.webadmin.cbi_add_networks(net)
|
||||
|
||||
|
|
|
@ -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() }
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -17,8 +17,8 @@ $Id$
|
|||
<p><%_This is the administration area of <abbr title="Lua Configuration Interface">LuCI</abbr>.%></p>
|
||||
<p><%_<abbr title="Lua Configuration Interface">LuCI</abbr> is a free, flexible, and user friendly graphical interface for configuring OpenWrt Kamikaze.%><br />
|
||||
<%:On the following pages you can adjust all important settings of your router.%></p>
|
||||
<p><%_Notice: In <abbr title="Lua Configuration Interface">LuCI</abbr> changes have to be confirmed by clicking Changes - Save & Apply before being applied.%></p>
|
||||
<p><%_Notice: In <abbr title="Lua Configuration Interface">LuCI</abbr> changes have to be confirmed by clicking Changes - Save & Apply before being applied.%></p>
|
||||
<p><%:As we always want to improve this interface we are looking forward to your feedback and suggestions.%></p>
|
||||
<p><%:And now have fun with your router!%></p>
|
||||
<p><em><strong><a href="<%=controller%>/about"><%_The <abbr title="Lua Configuration Interface">LuCI</abbr> Team%></a></strong></em></p>
|
||||
<%+footer%>
|
||||
<%+footer%>
|
||||
|
|
Loading…
Reference in a new issue