i18n-editor
i18n-editor copied to clipboard
Add undo/redo functionality
Add undo/redo functionality to translation changes.
@jcbvm I am starting to work with this issue and I would like to know what is the scope of the undo / redo. If this applies for word to translate or for translations in different languages? Thank you!
@jcbvm We started to read the code and we would like you to help us understand a bit more the structure of the project, especially the functionality of TranslationTree
@DiazMaxiM Not sure yet how undo/redo should work yet. Most of the time I think you might want to undo the addition of a translation or the removal of a key. So basicly action on the translation tree.
@rozaracho Sure, what do you want to know? The resources (the actual translations) are separated from the GUI, so every action performed (adding, removing, duplicating) will perform two actions, first it will update the underlying resource, secondly it will update the TranslationTree (the tree you see on the left hand side of the app). So basically the TranslationTree is responsible for showing the nodes only and performing transformations on the nodes. Both the translation tree and the resources work with so called translation keys. For the resources this are the keys of the underlying map it stores the translations in. For the tree the keys are used to build the tree structure (see TranslationTreeNode)
@jcbvm every time an onKeyPress is done is the resources updated? Could we observe the resources and save the different states by applying the Pattern Moment?
@DiazMaxiM Like I said, I think the actions performed (adding translation, removing one etc) are the actions we want to undo/redo. Not entering a translation for a language itself (the textareas already have an undo/redo function). So the best place for saving the action is in 'duplicateTranslationKey', 'renameTranslationKey', 'removeTranslationKey' and 'addTranslationKey' in the Editor class.
@jcbvm We have the doubt if when we do undo about the action of eliminating we must recover the associated texts.