luci-base: uci.js: add extended section syntax support, improve loading
[oweals/luci.git] / modules / luci-base / luasrc / i18n.luadoc
1 ---[[
2 LuCI translation library.
3 ]]
4 module "luci.i18n"
5
6 ---[[
7 Set the context default translation language.
8
9 @class function
10 @name setlanguage
11 @param lang     An IETF/BCP 47 language tag or ISO3166 country code, e.g. "en-US" or "de"
12 @return         The effective loaded language, e.g. "en" for "en-US" - or nil on failure
13 ]]
14
15 ---[[
16 Return the translated value for a specific translation key.
17
18 @class function
19 @name translate
20 @param key      Default translation text
21 @return         Translated string
22 ]]
23
24 ---[[
25 Return the translated value for a specific translation key and use it as sprintf pattern.
26
27 @class function
28 @name translatef
29 @param key              Default translation text
30 @param ...              Format parameters
31 @return                 Translated and formatted string
32 ]]
33
34 ---[[
35 Return all currently loaded translation strings as a key-value table. The key is the
36 hexadecimal representation of the translation key while the value is the translated
37 text content.
38
39 @class function
40 @name dump
41 @return                 Key-value translation string table.
42 ]]