webmcp

diff framework/bin/langtool.lua @ 4:5e32ef998acf

Version 1.0.4

ui.link{...} with POST target can now be parameterized with BOTH content and text to allow HTML content for JavaScript browsers and a text-only version for accessiblity

Changes related to database selectors:
- Support for row-based locking
- New method :count(), caching and returning the number of rows, which WOULD have been returned by :exec()
- Bugfix: WHERE and HAVING expressions are now enclosed in parenthesis to avoid problems with operator precedence

ui.script{...} now supports external .js files

Changes in langtool.lua to cope with escaped new-line chars (\n)
author jbe/bsw
date Fri Dec 25 12:00:00 2009 +0100 (2009-12-25)
parents 9fdfb27f8e67
children 3d43a5cf17c1
line diff
     1.1 --- a/framework/bin/langtool.lua	Thu Dec 10 12:00:00 2009 +0100
     1.2 +++ b/framework/bin/langtool.lua	Fri Dec 25 12:00:00 2009 +0100
     1.3 @@ -94,6 +94,7 @@
     1.4                (not string.find(key, "^%s*%.%.[^%.]")) and
     1.5                (not string.find(key, "^%s*,[^,]"))
     1.6              then
     1.7 +              local key = key:gsub("\\n", "\n")
     1.8                translations[key] = false
     1.9              end
    1.10            end
    1.11 @@ -103,6 +104,7 @@
    1.12                (not string.find(key, "^%s*%.%.[^%.]")) and
    1.13                (not string.find(key, "^%s*,[^,]"))
    1.14              then
    1.15 +              local key = key:gsub("\\n", "\n")
    1.16                translations[key] = false
    1.17              end
    1.18            end
    1.19 @@ -178,9 +180,9 @@
    1.20    for num, key in ipairs(translation_keys) do
    1.21      local value = translations[key]
    1.22      if value then
    1.23 -      file:write(string.format("[%q] = %q;\n", key, value))
    1.24 +      file:write((string.format("[%q] = %q;\n", key, value):gsub("\\\n", "\\n"))) -- double () important to hide second result of gsub
    1.25      else
    1.26 -      file:write(string.format("[%q] = false;\n", key))
    1.27 +      file:write((string.format("[%q] = false;\n", key):gsub("\\\n", "\\n"))) -- double () important to hide second result of gsub
    1.28      end
    1.29    end
    1.30    file:write("}\n")

Impressum / About Us