projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
647a0d3
)
libs/core: explicitely load luci.i18n in network model
author
Jo-Philipp Wich
<jow@openwrt.org>
Sat, 15 Sep 2012 14:02:27 +0000
(14:02 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Sat, 15 Sep 2012 14:02:27 +0000
(14:02 +0000)
libs/core/luasrc/model/network.lua
patch
|
blob
|
history
diff --git
a/libs/core/luasrc/model/network.lua
b/libs/core/luasrc/model/network.lua
index
37b7923
..
cc57229
100644
(file)
--- a/
libs/core/luasrc/model/network.lua
+++ b/
libs/core/luasrc/model/network.lua
@@
-20,8
+20,7
@@
limitations under the License.
local type, next, pairs, ipairs, loadfile, table
= type, next, pairs, ipairs, loadfile, table
local type, next, pairs, ipairs, loadfile, table
= type, next, pairs, ipairs, loadfile, table
-local tonumber, tostring, math, i18n
- = tonumber, tostring, math, luci.i18n
+local tonumber, tostring, math = tonumber, tostring, math
local require = require
local require = require
@@
-33,6
+32,7
@@
local sys = require "luci.sys"
local utl = require "luci.util"
local dsp = require "luci.dispatcher"
local uci = require "luci.model.uci"
local utl = require "luci.util"
local dsp = require "luci.dispatcher"
local uci = require "luci.model.uci"
+local lng = require "luci.i18n"
module "luci.model.network"
module "luci.model.network"
@@
-718,13
+718,13
@@
end
function protocol.get_i18n(self)
local p = self:proto()
if p == "none" then
function protocol.get_i18n(self)
local p = self:proto()
if p == "none" then
- return
i18n
.translate("Unmanaged")
+ return
lng
.translate("Unmanaged")
elseif p == "static" then
elseif p == "static" then
- return
i18n
.translate("Static address")
+ return
lng
.translate("Static address")
elseif p == "dhcp" then
elseif p == "dhcp" then
- return
i18n
.translate("DHCP client")
+ return
lng
.translate("DHCP client")
else
else
- return
i18n
.translate("Unknown")
+ return
lng
.translate("Unknown")
end
end
end
end
@@
-1063,7
+1063,7
@@
end
function interface.get_i18n(self)
if self.wif then
return "%s: %s %q" %{
function interface.get_i18n(self)
if self.wif then
return "%s: %s %q" %{
-
i18n
.translate("Wireless Network"),
+
lng
.translate("Wireless Network"),
self.wif:active_mode(),
self.wif:active_ssid() or self.wif:active_bssid()
}
self.wif:active_mode(),
self.wif:active_ssid() or self.wif:active_bssid()
}
@@
-1075,17
+1075,17
@@
end
function interface.get_type_i18n(self)
local x = self:type()
if x == "wifi" then
function interface.get_type_i18n(self)
local x = self:type()
if x == "wifi" then
- return
i18n
.translate("Wireless Adapter")
+ return
lng
.translate("Wireless Adapter")
elseif x == "bridge" then
elseif x == "bridge" then
- return
i18n
.translate("Bridge")
+ return
lng
.translate("Bridge")
elseif x == "switch" then
elseif x == "switch" then
- return
i18n
.translate("Ethernet Switch")
+ return
lng
.translate("Ethernet Switch")
elseif x == "vlan" then
elseif x == "vlan" then
- return
i18n
.translate("VLAN Interface")
+ return
lng
.translate("VLAN Interface")
elseif x == "tunnel" then
elseif x == "tunnel" then
- return
i18n
.translate("Tunnel Interface")
+ return
lng
.translate("Tunnel Interface")
else
else
- return
i18n
.translate("Ethernet Adapter")
+ return
lng
.translate("Ethernet Adapter")
end
end
end
end
@@
-1396,7
+1396,7
@@
function wifinet.active_mode(self)
end
function wifinet.active_mode_i18n(self)
end
function wifinet.active_mode_i18n(self)
- return
i18n
.translate(self:active_mode())
+ return
lng
.translate(self:active_mode())
end
function wifinet.active_ssid(self)
end
function wifinet.active_ssid(self)
@@
-1485,15
+1485,15
@@
end
function wifinet.shortname(self)
return "%s %q" %{
function wifinet.shortname(self)
return "%s %q" %{
-
i18n
.translate(self:active_mode()),
+
lng
.translate(self:active_mode()),
self:active_ssid() or self:active_bssid()
}
end
function wifinet.get_i18n(self)
return "%s: %s %q (%s)" %{
self:active_ssid() or self:active_bssid()
}
end
function wifinet.get_i18n(self)
return "%s: %s %q (%s)" %{
-
i18n
.translate("Wireless Network"),
-
i18n
.translate(self:active_mode()),
+
lng
.translate("Wireless Network"),
+
lng
.translate(self:active_mode()),
self:active_ssid() or self:active_bssid(),
self:ifname()
}
self:active_ssid() or self:active_bssid(),
self:ifname()
}