luci-mod-dsl: add i18n
authorFlorian Eckert <fe@dev.tdt.de>
Fri, 4 Nov 2022 12:52:44 +0000 (13:52 +0100)
committerFlorian Eckert <fe@dev.tdt.de>
Fri, 4 Nov 2022 12:53:46 +0000 (13:53 +0100)
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js
modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/spectrum.js
modules/luci-mod-dsl/po/templates/dsl.pot [new file with mode: 0644]

index 26b3f6097fdd19ad137a87dfee7e18666dd8f6a4..ba0d590c18d5192139530e8dc61934d4b0a9b611 100644 (file)
@@ -103,23 +103,23 @@ let bitsChart = {
                "stepX": Math.max(dsBitsData.maxX, usBitsData.maxX) / 16,
                "graphWidth" : document.getElementById("bitsChart").width - 2 * marginX,
                "lineWidth" : 1,
-               "titleX" : "Sub-carrier",
+               "titleX" : _("Sub-carrier"),
                "minY" : 0,
                "maxY" : 16,
                "stepY": 2,
                "graphHeight" : document.getElementById("bitsChart").height - 2 * marginY,
-               "titleY" : "bits",
+               "titleY" : _("bits")
        },
        "dataSet" : [
                {
                        "data" :usBitsData.data,
                        "color":"YellowGreen",
-                       "title": "Upstream bits allocation"
+                       "title": ("Upstream bits allocation")
                },
                {
                        "data" : dsBitsData.data,
                        "color": "navy",
-               "title": "Downstream bits allocation"
+                       "title": _("Downstream bits allocation")
                }
        ]
 };
@@ -133,23 +133,23 @@ let dBChart = {
                "stepX": Math.max(dsSnrData.maxX, usSnrData.maxX) / 16,
                "graphWidth" : document.getElementById("dbChart").width - 2 * marginX,
                "lineWidth": 4,
-               "titleX" : "Sub-carrier",
+               "titleX" : _("Sub-carrier"),
                "minY" : -40,
                "maxY" : 100,
                "stepY": 10,
                "graphHeight" : document.getElementById("dbChart").height - 2 * marginY,
-               "titleY" : "dB"
+               "titleY" : _("dB")
        },
        "dataSet" : [
                {
                        "data" :usSnrData.data,
                        "color":"Turquoise",
-                       "title": "Upstream SNR"
+                       "title": _("Upstream SNR")
                },
                {
                        "data" : dsSnrData.data,
                        "color": "Coral",
-                       "title" : "Downstream SNR"
+                       "title" : _("Downstream SNR")
                }
        ]
 };
@@ -163,23 +163,23 @@ let qLNChart = {
                "stepX": Math.max(dsQLNData.maxX, usQLNData.maxX) / 16,
                "graphWidth" : document.getElementById("qlnChart").width - 2 * marginX,
                "lineWidth": 4,
-               "titleX" : "Sub-carrier",
+               "titleX" : _("Sub-carrier"),
                "minY" : -150,
                "maxY" : -20,
                "stepY": 10,
                "graphHeight" : document.getElementById("qlnChart").height - 2 * marginY,
-               "titleY" : "dBm/Hz"
+               "titleY" : _("dBm/Hz")
        },
        "dataSet" : [
                {
                        "data" :usQLNData.data,
                        "color":"brown",
-                       "title": "Upstream QLN"
+                       "title": _("Upstream QLN")
                },
                {
                        "data" : dsQLNData.data,
                        "color": "teal",
-                       "title" : "Downstream QLN"
+                       "title" : _("Downstream QLN")
                }
        ]
 };
@@ -193,23 +193,23 @@ let hLogChart = {
                "stepX": Math.max(dsHLOGData.maxX, usHLOGData.maxX) / 16,
                "graphWidth" : document.getElementById("hlogChart").width - 2 * marginX,
                "lineWidth": 4,
-               "titleX" : "Sub-carrier",
+               "titleX" : _("Sub-carrier"),
                "minY" : -100,
                "maxY" : 14,
                "stepY": 10,
                "graphHeight" : document.getElementById("hlogChart").height - 2 * marginY,
-               "titleY" : "dB"
+               "titleY" : _("dB")
        },
        "dataSet" : [
                {
                        "data" :usHLOGData.data,
                        "color":"#E8E800",
-                       "title": "Upstream HLOG"
+                       "title": _("Upstream HLOG")
                },
                {
                        "data" : dsHLOGData.data,
                        "color": "darkmagenta",
-                       "title" : "Downstream HLOG"
+                       "title" : _("Downstream HLOG")
                }
        ]
 };
index 7c8a7ca049c0504dc14a9996e1aeb0637eb28f99..83884daa84729aeb72aa9d5779b5027c985365b1 100644 (file)
@@ -22,7 +22,7 @@ return view.extend({
 
                var v = E([], [
                        E('h2', {'style': "height: 40px"}, [ _('DSL line spectrum') ]),
-                       E('p', {}, 'Graphs below show Signal-to-noise ratio, Bit allocation, Quiet line noise and Channel characteristics function (HLOG) per sub-carrier.'),
+                       E('p', {}, _('Graphs below show Signal-to-noise ratio, Bit allocation, Quiet line noise and Channel characteristics function (HLOG) per sub-carrier.')),
                        E('div', {'style': "height: 360px; width: 1024px"},
                                E('canvas', {
                                        'id': 'dbChart',
diff --git a/modules/luci-mod-dsl/po/templates/dsl.pot b/modules/luci-mod-dsl/po/templates/dsl.pot
new file mode 100644 (file)
index 0000000..90a8657
--- /dev/null
@@ -0,0 +1,65 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+#: modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/spectrum.js:24
+#: modules/luci-mod-dsl/root/usr/share/luci/menu.d/luci-mod-dsl.json:3
+msgid "DSL line spectrum"
+msgstr ""
+
+#: modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js:212
+msgid "Downstream HLOG"
+msgstr ""
+
+#: modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js:182
+msgid "Downstream QLN"
+msgstr ""
+
+#: modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js:152
+msgid "Downstream SNR"
+msgstr ""
+
+#: modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js:122
+msgid "Downstream bits allocation"
+msgstr ""
+
+#: modules/luci-mod-dsl/root/usr/share/rpcd/acl.d/luci-mod-dsl.json:3
+msgid "Grant access to luci-mod-dsl spectrum"
+msgstr ""
+
+#: modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/spectrum.js:25
+msgid ""
+"Graphs below show Signal-to-noise ratio, Bit allocation, Quiet line noise "
+"and Channel characteristics function (HLOG) per sub-carrier."
+msgstr ""
+
+#: modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js:106
+#: modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js:136
+#: modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js:166
+#: modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js:196
+msgid "Sub-carrier"
+msgstr ""
+
+#: modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js:207
+msgid "Upstream HLOG"
+msgstr ""
+
+#: modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js:177
+msgid "Upstream QLN"
+msgstr ""
+
+#: modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js:147
+msgid "Upstream SNR"
+msgstr ""
+
+#: modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js:111
+msgid "bits"
+msgstr ""
+
+#: modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js:141
+#: modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js:201
+msgid "dB"
+msgstr ""
+
+#: modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js:171
+msgid "dBm/Hz"
+msgstr ""