luci-app-mwan3: translate missing text in diagnostic page 2120/head
authorFlorian Eckert <fe@dev.tdt.de>
Thu, 30 Aug 2018 12:41:06 +0000 (14:41 +0200)
committerFlorian Eckert <fe@dev.tdt.de>
Thu, 30 Aug 2018 12:44:58 +0000 (14:44 +0200)
Translate missing text.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
applications/luci-app-mwan3/luasrc/controller/mwan3.lua

index 5fa8d8a9194e6e65e8ecb6417a7a45192312ed00..d2d7422a6b986ceff0967b68874e472abd2b95a6 100644 (file)
@@ -155,7 +155,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(string.format("No gateway for interface %s found.", interface))
+                               luci.http.write(translatef("No gateway for interface %s found.", interface))
                        end
                elseif task == "ping_trackips" then
                        local trackips = uci:get("mwan3", interface, "track_ip")
@@ -164,7 +164,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(string.format("No tracking Hosts for interface %s defined.", interface))
+                               luci.http.write(translatef("No tracking Hosts for interface %s defined.", interface))
                        end
                elseif task == "check_rules" then
                        local number = getInterfaceNumber(interface)
@@ -173,30 +173,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(string.format("All required IP rules for interface %s found", interface))
+                               luci.http.write(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(string.format("Only one IP rules for interface %s found", interface))
+                               luci.http.write(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(string.format("Only one IP rules for interface %s found", interface))
+                               luci.http.write(translatef("Only one IP rules for interface %s found", interface))
                                luci.http.write("\n")
                                luci.http.write(iif_rule)
                        else
-                               luci.http.write(string.format("Missing both IP rules for interface %s", interface))
+                               luci.http.write(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(string.format("Routing table %s for interface %s found", number, interface))
+                               luci.http.write(translatef("Routing table %s for interface %s found", number, interface))
                                luci.http.write("\n")
                                luci.http.write(routeTable)
                        else
-                               luci.http.write(string.format("Routing table %s for interface %s not found", number, interface))
+                               luci.http.write(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)))