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:
parent
ffadc0dd69
commit
c4636343b4
15 changed files with 215 additions and 18 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue