From 2815def1321a3b35c87463a2777d3717a46eb9f5 Mon Sep 17 00:00:00 2001 From: Manuel Munz Date: Fri, 11 Feb 2011 18:48:40 +0000 Subject: applications/ffwizard: Fixes for i18n --- applications/luci-ffwizard/Makefile | 2 +- .../luci-ffwizard/luasrc/controller/ffwizard.lua | 7 +++++-- .../luci-ffwizard/luasrc/model/cbi/freifunk/ffwizard.lua | 16 ++++++++-------- 3 files changed, 14 insertions(+), 11 deletions(-) (limited to 'applications') diff --git a/applications/luci-ffwizard/Makefile b/applications/luci-ffwizard/Makefile index a4f7c76ef..c0445b998 100644 --- a/applications/luci-ffwizard/Makefile +++ b/applications/luci-ffwizard/Makefile @@ -1,4 +1,4 @@ -PO = +PO = ffwizard include ../../build/config.mk include ../../build/module.mk diff --git a/applications/luci-ffwizard/luasrc/controller/ffwizard.lua b/applications/luci-ffwizard/luasrc/controller/ffwizard.lua index 5ad48eeab..50753d877 100644 --- a/applications/luci-ffwizard/luasrc/controller/ffwizard.lua +++ b/applications/luci-ffwizard/luasrc/controller/ffwizard.lua @@ -18,8 +18,11 @@ $Id$ module "luci.controller.ffwizard" function index() - entry({"admin", "freifunk", "ffwizard"}, form("freifunk/ffwizard"), "Freifunkassistent", 40) - assign({"mini", "freifunk", "ffwizard"}, {"admin", "freifunk", "ffwizard"}, "Freifunkassistent", 40) + require("luci.i18n").loadc("ffwizard") + local i18n = luci.i18n.translate + + entry({"admin", "freifunk", "ffwizard"}, form("freifunk/ffwizard"), i18n("Wizard"), 40) + assign({"mini", "freifunk", "ffwizard"}, {"admin", "freifunk", "ffwizard"}, i18n("Wizard"), 40) entry({"admin", "freifunk", "ffwizard_error"}, template("freifunk/ffwizard_error")) assign({"mini", "freifunk", "ffwizard_error"}, {"admin", "freifunk", "ffwizard_error"}) diff --git a/applications/luci-ffwizard/luasrc/model/cbi/freifunk/ffwizard.lua b/applications/luci-ffwizard/luasrc/model/cbi/freifunk/ffwizard.lua index 8a6e07836..0094d0696 100644 --- a/applications/luci-ffwizard/luasrc/model/cbi/freifunk/ffwizard.lua +++ b/applications/luci-ffwizard/luasrc/model/cbi/freifunk/ffwizard.lua @@ -36,11 +36,11 @@ local lat = uci:get_first("system", "system", "latitude") local lon = uci:get_first("system", "system", "longitude") local suffix = uci:get_first(community, "community", "suffix") or "olsr" -luci.i18n.loadc("freifunk") +luci.i18n.loadc("ffwizard") -- Check if all necessary variables are available if not (community ~= "profile_na" and lat and lon) then - luci.http.redirect(luci.dispatcher.build_url(unpack(luci.dispatcher.context.requested.path), "freifunk", "ffwizard_error")) + luci.http.redirect(luci.dispatcher.build_url("admin", "freifunk", "ffwizard_error")) return end @@ -117,7 +117,7 @@ function cbi_meship6(dev) end function cbi_netconf(dev) - local d = f:field(Flag, "device_" .. dev , " " .. dev:upper() .. "", "Configure this interface.") + local d = f:field(Flag, "device_" .. dev , " " .. dev:upper() .. "", translate("Configure this interface.")) d:depends("netconfig", "1") d.rmempty = false function d.cfgvalue(self, section) @@ -321,7 +321,7 @@ function wanproto.write(self, section, value) uci:set("network", "wan", "proto", value) uci:save("network") end -wanip = f:field(Value, "wanipaddr", translate("Ip address")) +wanip = f:field(Value, "wanipaddr", translate("IP address")) wanip:depends("wanproto", "static") function wanip.cfgvalue(self, section) return uci:get("network", "wan", "ipaddr") @@ -381,7 +381,7 @@ function wanpwd.write(self, section, value) uci:save("network") end -wansec = f:field(Flag, "wansec", translate("Protect LAN"), translate("Check this to protect your LAN from other nodes or clients" .. " (" .. translate("recommended") .. ").")) +wansec = f:field(Flag, "wansec", translate("Protect LAN"), translate("Check this to protect your LAN from other nodes or clients") .. " (" .. translate("recommended") .. ").") wansec.default = "1" wansec.rmempty = false wansec:depends("wanproto", "static") @@ -437,7 +437,7 @@ if has_l2gvpn then end if has_hb then - hb = f:field(Flag, "hb", translate("Heartbeat"), translate("Allow to transfer anonymous statistics about this node" .. " (" .. translate("recommended") .. ").")) + hb = f:field(Flag, "hb", translate("Heartbeat"), translate("Allow to transfer anonymous statistics about this node") .. " (" .. translate("recommended") .. ").") hb.rmempty = false hb:depends("netconfig", "1") function hb.cfgvalue(self, section) @@ -457,9 +457,9 @@ function f.handle(self, state, data) if data.pw1 then local stat = luci.sys.user.setpasswd("root", data.pw1) == 0 if stat then - f.message = translate("a_s_changepw_changed") + f.message = translate("Password successfully changed") else - f.errmessage = translate("unknownerror") + f.errmessage = translate("Unknown Error") end end data.pw1 = nil -- cgit v1.2.3