wagtail-localize
wagtail-localize copied to clipboard
Move tree synchronisation feature into Wagtail core
The tree synchronisation feature creates alias pages of all the content in one locale into another. This is configured using the "Synchronise from" field on the locale.
Merging this feature into Wagtail core will simplify things a little bit. Firstly it removes the need for the wagtail_localize.locales app and makes Wagtail Localize purely a translation app. This change would also allow the tree synchronisation feature to be used by other translation apps
We should add this field directly on Wagtail core's Locale model (currently it's on wagtaillocalize.LocaleSynchronisation) and move the synctree.py module into Wagtail core somewhere.
Before this move, we should solve the following issues:
- [ ] Two way synchronisation
- [ ] Allow different sites to have different locale configurations (https://github.com/unicef/iogt/issues/21#issuecomment-829060696)
- [ ] Changing the "sync from" field should update the aliases
- [ ] Figure out how we can make the initial sync run in a background worker
Need to consider if this is a blocker too: https://github.com/wagtail/wagtail-localize/issues/469
Page tree sync added to core simple_translation in https://github.com/wagtail/wagtail/pull/7548
The code in https://github.com/wagtail/wagtail/pull/7548 is something of a partial solution. It adds the after_create_page hook to core, so if you enable WAGTAILSIMPLETRANSLATION_SYNC_PAGE_TREE then it will create mirrors for any new pages you create after that point, but it doesn't port anything comparable to sync_trees_on_locale_sync_save so if you enable a new locale on a site with existing content, any existing content won't be mirrored.
We've noted that adding new locales to sites with a lot of existing content is a place where you can run into performance issues with the localize approach so perhaps that is a reason why we've chosen not to port that bit, but just wanted to note the constraint here.
I agree. I suppose I was thinking for new sites when I posted the comment above.
We do have a note to add a background worker mecahnism for the full tree sync to avoid the performance issues. This is where https://github.com/wagtail/rfcs/pull/72 would come in handy