luci-base: fix luci.i18n.setlanguage()
authorJo-Philipp Wich <jo@mein.io>
Thu, 18 Oct 2018 07:52:07 +0000 (09:52 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 5 Nov 2018 10:01:45 +0000 (11:01 +0100)
commit08255e266b590e43c2c9362206928ff7c8a9ab5c
tree1de1e1e2bfbf8973de80d1963feca83e845f3b00
parent62102f4f0e8a88ffbdf44517f4ff737049a3f3bf
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>
modules/luci-base/luasrc/i18n.lua
modules/luci-base/luasrc/i18n.luadoc