luci-base: fix bug in util.lua in 'shellsqescape'
[project/luci.git] / modules / luci-base / luasrc / i18n.luadoc
1 ---[[
2 LuCI translation library.
3 ]]
4 module "luci.i18n"
5
6 ---[[
7 Clear the translation table.
8
9
10 @class function
11 @name clear
12 ]]
13
14 ---[[
15 Load a translation and copy its data into the translation table.
16
17 @class function
18 @name load
19 @param file     Language file
20 @param lang     Two-letter language code
21 @param force    Force reload even if already loaded (optional)
22 @return         Success status
23 ]]
24
25 ---[[
26 Load a translation file using the default translation language.
27
28 Alternatively load the translation of the fallback language.
29 @class function
30 @name loadc
31 @param file     Language file
32 @param force    Force reload even if already loaded (optional)
33 ]]
34
35 ---[[
36 Set the context default translation language.
37
38 @class function
39 @name setlanguage
40 @param lang     Two-letter language code
41 ]]
42
43 ---[[
44 Return the translated value for a specific translation key.
45
46 @class function
47 @name translate
48 @param key      Default translation text
49 @return         Translated string
50 ]]
51
52 ---[[
53 Return the translated value for a specific translation key and use it as sprintf pattern.
54
55 @class function
56 @name translatef
57 @param key              Default translation text
58 @param ...              Format parameters
59 @return                 Translated and formatted string
60 ]]
61
62 ---[[
63 Return the translated value for a specific translation key
64
65 and ensure that the returned value is a Lua string value.
66 This is the same as calling <code>tostring(translate(...))</code>
67 @class function
68 @name string
69 @param key              Default translation text
70 @return                 Translated string
71 ]]
72
73 ---[[
74 Return the translated value for a specific translation key and use it as sprintf pattern.
75
76 Ensure that the returned value is a Lua string value.
77 This is the same as calling <code>tostring(translatef(...))</code>
78 @class function
79 @name stringf
80 @param key              Default translation text
81 @param ...              Format parameters
82 @return                 Translated and formatted string
83 ]]
84