From 977c9ac6c69a4e4a79101c8c949d1d9af08799fb Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Fri, 4 Nov 2022 13:52:44 +0100 Subject: [PATCH] luci-mod-dsl: add i18n Signed-off-by: Florian Eckert --- .../resources/view/status/dsl/graph.js | 32 ++++----- .../resources/view/status/dsl/spectrum.js | 2 +- modules/luci-mod-dsl/po/templates/dsl.pot | 65 +++++++++++++++++++ 3 files changed, 82 insertions(+), 17 deletions(-) create mode 100644 modules/luci-mod-dsl/po/templates/dsl.pot diff --git a/modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js b/modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js index 26b3f6097f..ba0d590c18 100644 --- a/modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js +++ b/modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/graph.js @@ -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") } ] }; diff --git a/modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/spectrum.js b/modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/spectrum.js index 7c8a7ca049..83884daa84 100644 --- a/modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/spectrum.js +++ b/modules/luci-mod-dsl/htdocs/luci-static/resources/view/status/dsl/spectrum.js @@ -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 index 0000000000..90a8657ab7 --- /dev/null +++ b/modules/luci-mod-dsl/po/templates/dsl.pot @@ -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 "" -- 2.30.2