From 211c6394a0d145d3215893b827241723bb358a13 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Mon, 9 Jun 2008 10:10:29 +0000 Subject: * Prepare german translation cleanup --- libs/web/luasrc/template.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libs/web') 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 -- cgit v1.2.3