From 4058aacd0635e1b585993e065974edb17329f014 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 2 Jun 2008 00:48:25 +0000 Subject: [PATCH] * luci/statistics: template and controller translation --- .../luci_statistics/luci_statistics.lua | 90 +++++++++---------- .../luci-statistics/luasrc/i18n/statistics.en | 18 ++++ .../luasrc/view/admin_statistics/index.htm | 6 +- .../view/admin_statistics/networkplugins.htm | 8 +- .../view/admin_statistics/outputplugins.htm | 10 +-- .../view/admin_statistics/systemplugins.htm | 7 +- 6 files changed, 74 insertions(+), 65 deletions(-) diff --git a/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua b/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua index f19d2cdb7..7fdedfbec 100644 --- a/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua +++ b/applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua @@ -11,7 +11,7 @@ function index() require("luci.statistics.datatree") -- load language file - luci.i18n.load("statistics.en") + luci.i18n.load("statistics.en") -- XXX: temporary / replace with loadc() -- get rrd data tree local tree = luci.statistics.datatree.Instance() @@ -35,32 +35,32 @@ function index() end - entry({"admin", "statistics"}, call("statistics_index"), "Statistiken", 80) - entry({"admin", "statistics", "collectd"}, cbi("luci_statistics/collectd"), "Collectd", 10) - - entry({"admin", "statistics", "output"}, call("statistics_outputplugins"), "Ausgabeplugins", 20) - _entry({"admin", "statistics", "output", "rrdtool"}, cbi("luci_statistics/rrdtool"), "RRDTool", 10) - _entry({"admin", "statistics", "output", "network"}, cbi("luci_statistics/network"), "Netzwerk", 20) - _entry({"admin", "statistics", "output", "unixsock"}, cbi("luci_statistics/unixsock"), "Unix Socket", 30) - _entry({"admin", "statistics", "output", "csv"}, cbi("luci_statistics/csv"), "CSV", 40) - - entry({"admin", "statistics", "system"}, call("statistics_systemplugins"), "Systemplugins", 30) - _entry({"admin", "statistics", "system", "exec"}, cbi("luci_statistics/exec"), "Exec", 10) - _entry({"admin", "statistics", "system", "email"}, cbi("luci_statistics/email"), "E-Mail", 20) - _entry({"admin", "statistics", "system", "cpu"}, cbi("luci_statistics/cpu"), "Prozessor", 30) - _entry({"admin", "statistics", "system", "df"}, cbi("luci_statistics/df"), "Speicherplatz", 40) - _entry({"admin", "statistics", "system", "disk"}, cbi("luci_statistics/disk"), "Datenträger", 50) - _entry({"admin", "statistics", "system", "irq"}, cbi("luci_statistics/irq"), "Interrupts", 60) - _entry({"admin", "statistics", "system", "processes"}, cbi("luci_statistics/processes"), "Prozesse", 70) - - entry({"admin", "statistics", "network"}, call("statistics_networkplugins"), "Netzwerkplugins", 40) - _entry({"admin", "statistics", "network", "interface"}, cbi("luci_statistics/interface"), "Schnittstellen", 10) - _entry({"admin", "statistics", "network", "netlink"}, cbi("luci_statistics/netlink"), "Netlink", 20) - _entry({"admin", "statistics", "network", "iptables"}, cbi("luci_statistics/iptables"), "Firewall", 30) - _entry({"admin", "statistics", "network", "tcpconns"}, cbi("luci_statistics/tcpconns"), "Verbindungen", 40) - _entry({"admin", "statistics", "network", "ping"}, cbi("luci_statistics/ping"), "Ping", 50) - _entry({"admin", "statistics", "network", "dns"}, cbi("luci_statistics/dns"), "DNS", 60) - _entry({"admin", "statistics", "network", "wireless"}, cbi("luci_statistics/wireless"), "Drahtlos", 70) + entry({"admin", "statistics"}, call("statistics_index"), _i18n("statistics"), 80).i18n = "statistics" + entry({"admin", "statistics", "collectd"}, cbi("luci_statistics/collectd"), _i18n("collectd"), 10) + + entry({"admin", "statistics", "output"}, call("statistics_outputplugins"), _i18n("outputplugins"), 20) + _entry({"admin", "statistics", "output", "rrdtool"}, cbi("luci_statistics/rrdtool"), _i18n("rrdtool"), 10) + _entry({"admin", "statistics", "output", "network"}, cbi("luci_statistics/network"), _i18n("network"), 20) + _entry({"admin", "statistics", "output", "unixsock"}, cbi("luci_statistics/unixsock"), _i18n("unixsock"), 30) + _entry({"admin", "statistics", "output", "csv"}, cbi("luci_statistics/csv"), _i18n("csv"), 40) + + entry({"admin", "statistics", "system"}, call("statistics_systemplugins"), _i18n("systemplugins"), 30) + _entry({"admin", "statistics", "system", "exec"}, cbi("luci_statistics/exec"), _i18n("exec"), 10) + _entry({"admin", "statistics", "system", "email"}, cbi("luci_statistics/email"), _i18n("email"), 20) + _entry({"admin", "statistics", "system", "cpu"}, cbi("luci_statistics/cpu"), _i18n("cpu"), 30) + _entry({"admin", "statistics", "system", "df"}, cbi("luci_statistics/df"), _i18n("df"), 40) + _entry({"admin", "statistics", "system", "disk"}, cbi("luci_statistics/disk"), _i18n("disk"), 50) + _entry({"admin", "statistics", "system", "irq"}, cbi("luci_statistics/irq"), _i18n("irq"), 60) + _entry({"admin", "statistics", "system", "processes"}, cbi("luci_statistics/processes"), _i18n("processes"), 70) + + entry({"admin", "statistics", "network"}, call("statistics_networkplugins"), _i18n("networkplugins"),40) + _entry({"admin", "statistics", "network", "interface"}, cbi("luci_statistics/interface"), _i18n("interface"), 10) + _entry({"admin", "statistics", "network", "netlink"}, cbi("luci_statistics/netlink"), _i18n("netlink"), 20) + _entry({"admin", "statistics", "network", "iptables"}, cbi("luci_statistics/iptables"), _i18n("iptables"), 30) + _entry({"admin", "statistics", "network", "tcpconns"}, cbi("luci_statistics/tcpconns"), _i18n("tcpconns"), 40) + _entry({"admin", "statistics", "network", "ping"}, cbi("luci_statistics/ping"), _i18n("ping"), 50) + _entry({"admin", "statistics", "network", "dns"}, cbi("luci_statistics/dns"), _i18n("dns"), 60) + _entry({"admin", "statistics", "network", "wireless"}, cbi("luci_statistics/wireless"), _i18n("wireless"), 70) -- public views @@ -93,37 +93,31 @@ function statistics_index() end function statistics_outputplugins() - plugins = { - rrdtool="RRDTool", - network="Netzwerk", - unixsock="Unix Socket", - csv="CSV" - } + local plugins = { } + + for i, p in ipairs({ "rrdtool", "network", "unixsock", "csv" }) do + plugins[p] = luci.i18n.translate( "stat_" .. p, p ) + end luci.template.render("admin_statistics/outputplugins", {plugins=plugins}) end function statistics_systemplugins() - plugins = { - exec="Exec", - email="E-Mail", - disk="Datenträger", - irq="Interrupts", - processes="Prozesse" - } + local plugins = { } + + for i, p in ipairs({ "exec", "email", "df", "disk", "irq", "processes", "cpu" }) do + plugins[p] = luci.i18n.translate( "stat_" .. p, p ) + end luci.template.render("admin_statistics/systemplugins", {plugins=plugins}) end function statistics_networkplugins() - plugins = { - interface="Schnittstellen", - netlink="Netlink", - iptables="Firewall", - tcpconns="Verbindungen", - ping="Ping", - dns="DNS" - } + local plugins = { } + + for i, p in ipairs({ "interface", "netlink", "iptables", "tcpconns", "ping", "dns", "wireless" }) do + plugins[p] = luci.i18n.translate( "stat_" .. p, p ) + end luci.template.render("admin_statistics/networkplugins", {plugins=plugins}) end diff --git a/applications/luci-statistics/luasrc/i18n/statistics.en b/applications/luci-statistics/luasrc/i18n/statistics.en index bd3b6bf1f..84f1c0e23 100644 --- a/applications/luci-statistics/luasrc/i18n/statistics.en +++ b/applications/luci-statistics/luasrc/i18n/statistics.en @@ -14,10 +14,21 @@ $Id$ ]]-- +-- +-- general translations +-- + +stat_statistics = "Statistics" +stat_systemplugins = "System plugins" +stat_networkplugins = "Network plugins" +stat_outputplugins = "Output plugins" + + -- -- collectd plugin translations -- +stat_collectd = "Collectd" stat_cpu = "Processor" stat_ping = "Ping" stat_iptables = "Firewall" @@ -28,11 +39,17 @@ stat_tcpconns = "TCP Connections" stat_interface = "Interfaces" stat_df = "Disk Space Usage" stat_irq = "Interrupts" +stat_disk = "Disk Usage" +stat_exec = "Exec" +stat_rrdtool = "RRDTool" +stat_network = "Network" +stat_csv = "CSV Output" -- -- diagram translations -- + stat_dg_title_wireless__signal_noise = "%H: Wireless - Signal Noise Ratio" stat_dg_label_wireless__signal_noise = "dBm" stat_ds_signal_noise = "Noise Level" @@ -121,6 +138,7 @@ stat_ds_irq = "IRQ %di" -- -- CBI translations -- + lucistatistics = "Statistics" -- general config diff --git a/applications/luci-statistics/luasrc/view/admin_statistics/index.htm b/applications/luci-statistics/luasrc/view/admin_statistics/index.htm index 2c1befa50..a6d7045c3 100644 --- a/applications/luci-statistics/luasrc/view/admin_statistics/index.htm +++ b/applications/luci-statistics/luasrc/view/admin_statistics/index.htm @@ -1,8 +1,8 @@ <%+header%> -

<%:stat Statistiken%>

+

<%:stat Statistics%>

-

<%:stat_desc Die Statistiken bauen auf Collectd auf und nutzen -RRD Tool um Graphen aus den erfassten Daten zu rendern.%>

+

<%:stat_desc The statistics package is based onCollectd +and uses RRD Tool to render diagram images from collected data.%>

<%+footer%> diff --git a/applications/luci-statistics/luasrc/view/admin_statistics/networkplugins.htm b/applications/luci-statistics/luasrc/view/admin_statistics/networkplugins.htm index d3aa87eb1..e88ca7f58 100644 --- a/applications/luci-statistics/luasrc/view/admin_statistics/networkplugins.htm +++ b/applications/luci-statistics/luasrc/view/admin_statistics/networkplugins.htm @@ -1,11 +1,11 @@ <%+header%> -

<%:stat_networkplugins Netzwerkplugins%>

+

<%:stat_networkplugins Network plugins%>

-

<%:stat_networkplugins_desc Netzwerkplugins sammeln Werte über offene TCP-Verbindung, allgemeines Verkehrsaufkommen -auf verschiedenen Schnittstellen, DNS-Verkehr u.v.m.%>

+

<%:stat_networkplugins_desc Network plugins are used to collect information +about open tcp connections, interface traffic, iptables rules etc.%>

-

<%:stat_networkplugins_installed Installierte Netzwerkplugins:%> +

<%:stat_networkplugins_installed Installed network plugins:%>