summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc/i18n.luadoc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2018-10-18 09:52:07 +0200
committerJo-Philipp Wich <jo@mein.io>2018-11-05 11:01:45 +0100
commit08255e266b590e43c2c9362206928ff7c8a9ab5c (patch)
tree1de1e1e2bfbf8973de80d1963feca83e845f3b00 /modules/luci-base/luasrc/i18n.luadoc
parent62102f4f0e8a88ffbdf44517f4ff737049a3f3bf (diff)
luci-base: fix luci.i18n.setlanguage()
Rework the setlanguage() implementation to actually switch catalogues if another language has been loaded previously and change it to return the effectively loaded language tag. Also improve input parameter validation and accept tags in both lower or upper case. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/luasrc/i18n.luadoc')
-rw-r--r--modules/luci-base/luasrc/i18n.luadoc3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/luci-base/luasrc/i18n.luadoc b/modules/luci-base/luasrc/i18n.luadoc
index aa38841e1..13f10a107 100644
--- a/modules/luci-base/luasrc/i18n.luadoc
+++ b/modules/luci-base/luasrc/i18n.luadoc
@@ -37,7 +37,8 @@ Set the context default translation language.
@class function
@name setlanguage
-@param lang Two-letter language code
+@param lang An IETF/BCP 47 language tag or ISO3166 country code, e.g. "en-US" or "de"
+@return The effective loaded language, e.g. "en" for "en-US" - or nil on failure
]]
---[[