summaryrefslogtreecommitdiff
path: root/gettext.lua
diff options
context:
space:
mode:
authorDiego Martínez <kaeza@users.noreply.github.com>2017-02-11 01:56:54 -0300
committerDiego Martínez <kaeza@users.noreply.github.com>2017-02-11 03:42:36 -0300
commit122d1a83cc380eb3919e28d20531b001c5cf8bac (patch)
treec15732cd5e198c42c64e81b5ef2a27d4a0a1faa3 /gettext.lua
parentc667cd0de67e01792072f66ee9f0d539f18f75ad (diff)
Fix warnings issued by `luacheck`.
Diffstat (limited to 'gettext.lua')
-rw-r--r--gettext.lua11
1 files changed, 4 insertions, 7 deletions
diff --git a/gettext.lua b/gettext.lua
index dff4ec3..a2e0eca 100644
--- a/gettext.lua
+++ b/gettext.lua
@@ -1,7 +1,6 @@
local strfind, strsub, strrep = string.find, string.sub, string.rep
local strmatch, strgsub = string.match, string.gsub
-local floor = math.floor
local function split(str, sep)
local pos, endp = 1, #str+1
@@ -103,6 +102,7 @@ local function parse_po(str)
return perror("malformed line")
+ -- luacheck: ignore
until true end -- end for
return texts
@@ -110,9 +110,6 @@ end
local M = { }
-local domains = { }
-local dgettext_cache = { }
-local dngettext_cache = { }
local langs
local function detect_languages()
@@ -166,8 +163,8 @@ end
-- Note that it assumes the C expression is valid to begin with.
local function compile_plural_forms(str)
local plural = strmatch(str, "plural=([^;]+);?$")
- local function replace_ternary(str)
- local c, t, f = strmatch(str, "^(.-)%?(.-):(.*)")
+ local function replace_ternary(s)
+ local c, t, f = strmatch(s, "^(.-)%?(.-):(.*)")
if c then
return ("__if("
..replace_ternary(c)
@@ -175,7 +172,7 @@ local function compile_plural_forms(str)
..","..replace_ternary(f)
..")")
end
- return str
+ return s
end
plural = replace_ternary(plural)
plural = strgsub(plural, "&&", " and ")