summaryrefslogtreecommitdiffhomepage
path: root/libs/web/luasrc/template.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-06-09 10:10:29 +0000
committerSteven Barth <steven@midlink.org>2008-06-09 10:10:29 +0000
commit211c6394a0d145d3215893b827241723bb358a13 (patch)
treedec8e0de5e24fb0476a599f93300f37013bded72 /libs/web/luasrc/template.lua
parent2bf012a40a7a6d0d35b5d61269fd1bafcdf527d6 (diff)
* Prepare german translation cleanup
Diffstat (limited to 'libs/web/luasrc/template.lua')
-rw-r--r--libs/web/luasrc/template.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/web/luasrc/template.lua b/libs/web/luasrc/template.lua
index cc534ab45..61e4e39ec 100644
--- a/libs/web/luasrc/template.lua
+++ b/libs/web/luasrc/template.lua
@@ -83,6 +83,7 @@ function compile(template)
-- Replacements
local r_include = "')\ninclude('%s')\nwrite('"
local r_i18n = "'..translate('%1','%2')..'"
+ local r_i18n2 = "'..translate('%1', '')..'"
local r_pexec = "'..(%s or '')..'"
local r_exec = "')\n%s\nwrite('"
@@ -93,7 +94,11 @@ function compile(template)
if p == "+" then
re = r_include:format(sanitize(string.sub(v, 2)))
elseif p == ":" then
- re = sanitize(v):gsub(":(.-) (.+)", r_i18n)
+ if v:find(" ") then
+ re = sanitize(v):gsub(":(.-) (.*)", r_i18n)
+ else
+ re = sanitize(v):gsub(":(.+)", r_i18n2)
+ end
elseif p == "=" then
re = r_pexec:format(v:sub(2))
else