2015-01-16 22:38:38 +00:00
-- Copyright 2008 Steven Barth <steven@midlink.org>
-- Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
-- Licensed to the public under the Apache License 2.0.
2009-07-19 00:24:58 +00:00
require " luci.config "
local fs = require " nixio.fs "
2009-10-31 15:54:11 +00:00
m = Map ( " luci " , translate ( " Web <abbr title= \" User Interface \" >UI</abbr> " ) , translate ( " Here you can customize the settings and the functionality of <abbr title= \" Lua Configuration Interface \" >LuCI</abbr>. " ) )
2008-07-15 14:33:29 +00:00
2008-09-20 22:11:41 +00:00
-- force reload of global luci config namespace to reflect the changes
function m . commit_handler ( self )
package.loaded [ " luci.config " ] = nil
2009-07-19 00:24:58 +00:00
require " luci.config "
2008-09-20 22:11:41 +00:00
end
2009-10-31 15:54:11 +00:00
c = m : section ( NamedSection , " main " , " core " , translate ( " General " ) )
2008-07-15 14:33:29 +00:00
2009-10-31 15:54:11 +00:00
l = c : option ( ListValue , " lang " , translate ( " Language " ) )
2009-01-14 23:47:56 +00:00
l : value ( " auto " )
2008-07-15 14:33:29 +00:00
2010-03-13 20:13:41 +00:00
local i18ndir = luci.i18n . i18ndir .. " base. "
2009-05-27 08:59:02 +00:00
for k , v in luci.util . kspairs ( luci.config . languages ) do
2009-04-04 22:54:16 +00:00
local file = i18ndir .. k : gsub ( " _ " , " - " )
2009-08-16 04:51:28 +00:00
if k : sub ( 1 , 1 ) ~= " . " and fs.access ( file .. " .lmo " ) then
2008-07-15 14:33:29 +00:00
l : value ( k , v )
end
end
2009-10-31 15:54:11 +00:00
t = c : option ( ListValue , " mediaurlbase " , translate ( " Design " ) )
2008-07-15 14:33:29 +00:00
for k , v in pairs ( luci.config . themes ) do
if k : sub ( 1 , 1 ) ~= " . " then
t : value ( v , k )
end
end
2008-09-20 22:11:41 +00:00
return m