From: Nicholas Smith Date: Mon, 2 Sep 2019 01:43:33 +0000 (+1000) Subject: luci-app-firewall: display "this new zone" instead of "undefined" X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f9e2d60f1399df4411f6b18f2705d7939815e9df;p=oweals%2Fluci.git luci-app-firewall: display "this new zone" instead of "undefined" Signed-off-by: Nicholas Smith --- diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js index 41840a226..78a662626 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js @@ -84,7 +84,8 @@ return L.view.extend({ o.modalonly = true; o.cfgvalue = function(section_id) { var name = uci.get('firewall', section_id, 'name'); - + if (name == null) + name = _("this new zone"); return _('This section defines common properties of %q. The input and output options set the default policies for traffic entering and leaving this zone while the forward option describes the policy for forwarded traffic between different networks within the zone. Covered networks specifies which available networks are members of this zone.') .replace(/%s/g, name).replace(/%q/g, '"' + name + '"'); }; @@ -168,7 +169,8 @@ return L.view.extend({ o.modalonly = true; o.cfgvalue = function(section_id) { var name = uci.get('firewall', section_id, 'name'); - + if (name == null) + name = _("this new zone"); return _('The options below control the forwarding policies between this zone (%s) and other zones. Destination zones cover forwarded traffic originating from %q. Source zones match forwarded traffic from other zones targeted at %q. The forwarding rule is unidirectional, e.g. a forward from lan to wan does not imply a permission to forward from wan to lan as well.') .format(name); }; @@ -258,8 +260,11 @@ return L.view.extend({ o.rawhtml = true; o.modalonly = true; o.cfgvalue = function(section_id) { + var name = uci.get('firewall', section_id, 'name'); + if (name == null) + name = _("this new zone"); return _('The options below control the forwarding policies between this zone (%s) and other zones. Destination zones cover forwarded traffic originating from %q. Source zones match forwarded traffic from other zones targeted at %q. The forwarding rule is unidirectional, e.g. a forward from lan to wan does not imply a permission to forward from wan to lan as well.') - .format(uci.get('firewall', section_id, 'name')); + .format(name); }; out = o = s.taboption('general', widgets.ZoneSelect, 'out', _('Allow forward to destination zones:')); diff --git a/applications/luci-app-firewall/po/templates/firewall.pot b/applications/luci-app-firewall/po/templates/firewall.pot index 753309b69..5c414af04 100644 --- a/applications/luci-app-firewall/po/templates/firewall.pot +++ b/applications/luci-app-firewall/po/templates/firewall.pot @@ -667,6 +667,10 @@ msgid "" "traffic flow." msgstr "" +#: applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js:88 +msgid "this new zone" +msgstr "" + #: applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js:169 #: applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js:257 msgid "" @@ -678,7 +682,7 @@ msgid "" "not imply a permission to forward from wan to lan as well." msgstr "" -#: applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js:88 +#: applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js:90 msgid "" "This section defines common properties of %q. The input and " "output options set the default policies for traffic entering and "