libs/web: export translatef() into templates
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 14 Aug 2012 15:31:26 +0000 (15:31 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 14 Aug 2012 15:31:26 +0000 (15:31 +0000)
libs/web/luasrc/dispatcher.lua

index 9c0bf60..9e5b78d 100644 (file)
@@ -304,6 +304,7 @@ function dispatch(request)
                   write       = luci.http.write;
                   include     = function(name) tpl.Template(name):render(getfenv(2)) end;
                   translate   = i18n.translate;
                   write       = luci.http.write;
                   include     = function(name) tpl.Template(name):render(getfenv(2)) end;
                   translate   = i18n.translate;
+                  translatef  = i18n.translatef;
                   export      = function(k, v) if tpl.context.viewns[k] == nil then tpl.context.viewns[k] = v end end;
                   striptags   = util.striptags;
                   pcdata      = util.pcdata;
                   export      = function(k, v) if tpl.context.viewns[k] == nil then tpl.context.viewns[k] = v end end;
                   striptags   = util.striptags;
                   pcdata      = util.pcdata;