Daandelange/kirby3-TranslatedLayout

Moving blocks to other columns or layouts erases translations

Daandelange opened this issue · 0 comments

Using the "grab handle" of a block, users can move the block around, which results in the translation loading the default lang in translations. After a translation save, the translation is erased (replaced by the default lang's value).

This happens because translations are stored as layout[id].column[id].block[id]. Moving them around, their "tree-structure-address" changes and the link breaks.

Solutions

Flatten all translated IDs in a single array (mixing layouts, columns, blocks), and look up IDs without respecting the arborescence. UUIDs need to be guaranteed unique for this to work, but that seems to be the case.
This solution could also speed up the parsing process and save some disk space (tree structure removed).