* luci/applications: statistics: pick up new rrdtool translations in controller and...
[project/luci.git] / applications / luci-statistics / luasrc / controller / luci_statistics / luci_statistics.lua
index f16a655dcff50eaf204b76cd19fa11a3ca8444dd..53ce34ec3be7a05ec466ecd2a345059006e799a2 100644 (file)
@@ -22,7 +22,8 @@ function index()
        require("luci.i18n")
        require("luci.statistics.datatree")
 
-       -- load language file
+       -- load language files
+       luci.i18n.loadc("rrdtool")
        luci.i18n.loadc("statistics")
 
        -- get rrd data tree
@@ -151,9 +152,9 @@ function statistics_render()
        local vars  = luci.http.formvalue()
        local req   = luci.dispatcher.context.request
        local path  = luci.dispatcher.context.dispatched.path
-       local uci   = luci.model.uci
-       local spans = luci.util.split( uci.get( "luci_statistics", "collectd_rrdtool", "RRATimespans" ), "%s+", nil, true )
-       local span  = vars.timespan or uci.get( "luci_statistics", "rrdtool", "default_timespan" ) or spans[1]
+       local uci   = luci.model.uci.cursor()
+       local spans = luci.util.split( uci:get( "luci_statistics", "collectd_rrdtool", "RRATimespans" ), "%s+", nil, true )
+       local span  = vars.timespan or uci:get( "luci_statistics", "rrdtool", "default_timespan" ) or spans[1]
        local graph = luci.statistics.rrdtool.Graph( luci.util.parse_units( span ) )
 
        local plugin, instances