diff options
author | Hannu Nyman <hannu.nyman@iki.fi> | 2018-10-02 18:00:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-02 18:00:26 +0300 |
commit | a90001419e207a9dbe3f78af4363b6e6a1d77530 (patch) | |
tree | bac573624290889644902d120868ff920302a275 | |
parent | 229c00227297b2f82af7bdb7b300c00f2a70cb99 (diff) | |
parent | ea59480e4eb8129bbd16125a536ba255a7ebb987 (diff) |
Merge pull request #2198 from TDT-AG/pr/20181002-luci-app-mwan3
luci-app-mwan3: fix i18n traceback
-rw-r--r-- | applications/luci-app-mwan3/luasrc/controller/mwan3.lua | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua index d2d7422a6..13d47e0dc 100644 --- a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua +++ b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua @@ -143,6 +143,7 @@ function diagnosticsData(interface, task) local uci = require "luci.model.uci".cursor(nil, "/var/state") local nw = require "luci.model.network".init() + local i18n = require "luci.i18n" local network = nw:get_network(interface) local device = network and network:get_interface() device = device:name() @@ -155,7 +156,7 @@ function diagnosticsData(interface, task) diag_command("ping -I %s -c 5 -W 1 %s 2>&1", device, gateway) else luci.http.prepare_content("text/plain") - luci.http.write(translatef("No gateway for interface %s found.", interface)) + luci.http.write(i18n.translatef("No gateway for interface %s found.", interface)) end elseif task == "ping_trackips" then local trackips = uci:get("mwan3", interface, "track_ip") @@ -164,7 +165,7 @@ function diagnosticsData(interface, task) diag_command("ping -I %s -c 5 -W 1 %s 2>&1", device, trackips[i]) end else - luci.http.write(translatef("No tracking Hosts for interface %s defined.", interface)) + luci.http.write(i18n.translatef("No tracking Hosts for interface %s defined.", interface)) end elseif task == "check_rules" then local number = getInterfaceNumber(interface) @@ -173,30 +174,30 @@ function diagnosticsData(interface, task) local iif_rule = sys.exec(string.format("ip rule | grep %d", iif)) local fwmark_rule = sys.exec(string.format("ip rule | grep %d", fwmark)) if iif_rule ~= "" and fwmark_rule ~= "" then - luci.http.write(translatef("All required IP rules for interface %s found", interface)) + luci.http.write(i18n.translatef("All required IP rules for interface %s found", interface)) luci.http.write("\n") luci.http.write(fwmark_rule) luci.http.write(iif_rule) elseif iif_rule == "" and fwmark_rule ~= "" then - luci.http.write(translatef("Only one IP rules for interface %s found", interface)) + luci.http.write(i18n.translatef("Only one IP rules for interface %s found", interface)) luci.http.write("\n") luci.http.write(fwmark_rule) elseif iif_rule ~= "" and fwmark_rule == "" then - luci.http.write(translatef("Only one IP rules for interface %s found", interface)) + luci.http.write(i18n.translatef("Only one IP rules for interface %s found", interface)) luci.http.write("\n") luci.http.write(iif_rule) else - luci.http.write(translatef("Missing both IP rules for interface %s", interface)) + luci.http.write(i18n.translatef("Missing both IP rules for interface %s", interface)) end elseif task == "check_routes" then local number = getInterfaceNumber(interface) local routeTable = sys.exec(string.format("ip route list table %s", number)) if routeTable ~= "" then - luci.http.write(translatef("Routing table %s for interface %s found", number, interface)) + luci.http.write(i18n.translatef("Routing table %s for interface %s found", number, interface)) luci.http.write("\n") luci.http.write(routeTable) else - luci.http.write(translatef("Routing table %s for interface %s not found", number, interface)) + luci.http.write(i18n.translatef("Routing table %s for interface %s not found", number, interface)) end elseif task == "hotplug_ifup" then os.execute(string.format("/usr/sbin/mwan3 ifup %s", ut.shellquote(interface))) |