Hello Bertrand,
I think the simplest way is to write some kind of preprocesor, for example:
local utf8 = require 'utf8'
local dict = {
if = "если",
then = "тогда",
else = "иначе",
elseif = "иначе_если",
end = "закончить",
function = "функция",
}
local to_russian = table.deepcopy(dict)
local from_russian = table.foreach(table.deepcopy(dict), function(t, k, v) t[v], t[k] = k, nil end)
local s = "%s"
for line in io.lines(arg[1]) do
utf8.gsub( line, s .. '(' .. keyword .. ')' .. s, repl )