luci-app-firewall: display "this new zone" instead of "undefined"
authorNicholas Smith <nicholas.smith@telcoantennas.com.au>
Mon, 2 Sep 2019 01:43:33 +0000 (11:43 +1000)
committerJo-Philipp Wich <jo@mein.io>
Wed, 11 Sep 2019 10:52:24 +0000 (12:52 +0200)
Signed-off-by: Nicholas Smith <nicholas.smith@telcoantennas.com.au>
applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js
applications/luci-app-firewall/po/templates/firewall.pot

index 41840a2268021262ae19be537c69769991c4d085..78a6626266c3776a6b5c5be56472a1049e8d1dee 100644 (file)
@@ -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 <em>input</em> and <em>output</em> options set the default policies for traffic entering and leaving this zone while the <em>forward</em> option describes the policy for forwarded traffic between different networks within the zone. <em>Covered networks</em> 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. <em>Destination zones</em> cover forwarded traffic <strong>originating from %q</strong>. <em>Source zones</em> match forwarded traffic from other zones <strong>targeted at %q</strong>. The forwarding rule is <em>unidirectional</em>, e.g. a forward from lan to wan does <em>not</em> 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. <em>Destination zones</em> cover forwarded traffic <strong>originating from %q</strong>. <em>Source zones</em> match forwarded traffic from other zones <strong>targeted at %q</strong>. The forwarding rule is <em>unidirectional</em>, e.g. a forward from lan to wan does <em>not</em> 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 <em>destination zones</em>:'));
index 753309b69d8be7ba2cef37a96700f0b4cacfe43a..5c414af049e346a5e80c4a2cf0175ae1526f67f7 100644 (file)
@@ -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 ""
 "<em>not</em> 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 <em>input</em> and "
 "<em>output</em> options set the default policies for traffic entering and "