summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc/i18n.lua
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2018-10-18 10:54:12 +0200
committerJo-Philipp Wich <jo@mein.io>2018-11-05 11:01:45 +0100
commita04028037e8ba142737ff39ac5a2e78f07bc75c3 (patch)
tree3db82b96435687d8f84abf97dafbf9598d43604a /modules/luci-base/luasrc/i18n.lua
parent08255e266b590e43c2c9362206928ff7c8a9ab5c (diff)
luci-base: introduce luci.i18n.dump()
Add a new luci.i18n.dump() function which returns all currently loaded translation strings as Lua table. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/luasrc/i18n.lua')
-rw-r--r--modules/luci-base/luasrc/i18n.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/luci-base/luasrc/i18n.lua b/modules/luci-base/luasrc/i18n.lua
index 968c387f1..42de832f7 100644
--- a/modules/luci-base/luasrc/i18n.lua
+++ b/modules/luci-base/luasrc/i18n.lua
@@ -69,3 +69,9 @@ end
function stringf(key, ...)
return tostring(translate(key)):format(...)
end
+
+function dump()
+ local rv = {}
+ tparser.get_translations(function(k, v) rv[k] = v end)
+ return rv
+end