532583828e3d64587df388994f4f11c86dc3fca1
[project/luci.git] / modules / niu / luasrc / model / cbi / niu / system / general1.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13 ]]--
14
15 local fs = require "nixio.fs"
16 local i18n = require "luci.i18n"
17 local util = require "luci.util"
18 local config = require "luci.config"
19
20 m = Map("system", translate("System"))
21
22 s = m:section(TypedSection, "system", "")
23 s.anonymous = true
24 s.addremove = false
25
26 hn = s:option(Value, "hostname", translate("Hostname"))
27
28
29
30 m2 = Map("luci", translate("Web <abbr title=\"User Interface\">UI</abbr>"))
31
32
33 c = m2:section(NamedSection, "main", "core")
34
35 l = c:option(ListValue, "lang", translate("Language"))
36 l:value("auto")
37
38 local i18ndir = i18n.i18ndir .. "default."
39 for k, v in util.kspairs(config.languages) do
40         local file = i18ndir .. k:gsub("_", "-")
41         if k:sub(1, 1) ~= "." and fs.access(file .. ".lmo") then
42                 l:value(k, v)
43         end
44 end
45 return m, m2