summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Martínez <kaeza@users.sf.net>2013-03-05 15:00:41 -0200
committerDiego Martínez <kaeza@users.sf.net>2013-03-05 15:00:41 -0200
commit5de9bcea76f851e64cfb1307bc3d321642cb5be2 (patch)
treed1783dd78b23fffd1129d61d77296aa53c6cc336
parent02b7a666f6e4e3253c44955fcfe9eb8fffd3eb5e (diff)
Remove non-working escape sequences
-rw-r--r--intllib.lua34
1 files changed, 1 insertions, 33 deletions
diff --git a/intllib.lua b/intllib.lua
index 732aa9d..bc89db3 100644
--- a/intllib.lua
+++ b/intllib.lua
@@ -18,47 +18,15 @@ else
TRACE = function ( ) end
end
-local repr2esc = {
- ["n"] = "\n";
- ["r"] = "";
- ["t"] = "\t";
- ["\\"] = "\\";
- ["\""] = "\"";
-};
-
-local esc2repr = {
- ["\n"] = "\\n";
- ["\r"] = "";
- ["\t"] = "\\t";
- ["\\"] = "\\\\";
- ["\\\""] = "\"";
-};
-
-local function parse ( s )
- return s:gsub("\\([nrt\"\'\\\\])", function ( c )
- return (repr2esc[c] or c);
- end);
-end
-
-local function repr ( s )
- return s:gsub("[\n\t\"\'\\\\]", function ( c )
- return (esc2repr[c] or c);
- end);
-end
-
local function do_load_strings ( f )
local msgstr = { };
for line in f:lines() do
line = line:trim();
if ((line ~= "") and (line:sub(1, 1) ~= "#")) then
local pos = line:find("=", 1, true);
- while (pos and (line:sub(pos - 1, pos - 1) == "\\")) do
- local pos = line:find("=", pos + 1, true);
- end
if (pos) then
local msgid = line:sub(1, pos - 1):trim();
- local str = line:sub(pos + 1):trim();
- msgstr[msgid] = parse(str);
+ msgstr[msgid] = line:sub(pos + 1):trim();
end
end
end