1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-28 00:59:31 +00:00

Translation system first draft

This commit is contained in:
Étienne Fildadut 2023-12-23 21:09:12 +01:00
parent ffadc0dd69
commit c4636343b4
15 changed files with 215 additions and 18 deletions

View file

@ -1,7 +1,9 @@
local ast = require("ast")
local Nil, Choice = ast.Nil, ast.Choice
local Nil, Choice, AttachBlock = ast.Nil, ast.Choice, ast.AttachBlock
local event_manager = require("state.event_manager")
local translation_manager = require("state.translation_manager")
local tag_manager = require("state.tag_manager")
return {
-- text
@ -21,4 +23,13 @@ return {
return Nil:new()
end
},
-- translation
{
"_->_", "(original::is(\"quote\"), translated::is(\"quote\"))",
function(state, original, translated)
translation_manager:set(state, tag_manager:get(state), original.expression, AttachBlock:preserve(state, translated.expression))
return Nil:new()
end
}
}