wagtail / wagtailtrans

A Wagtail add-on for supporting multilingual sites
http://wagtailtrans.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
104 stars 60 forks source link

WIP: Translatable mixin continued #168

Closed maerteijn closed 4 years ago

maerteijn commented 5 years ago

This is a continuation of the abandoned pull request #155

I'll add documentation and other fixes to this branch. We are testing this in a project now as well.

Things to do:

Update and explanation: We've been playing around a bit and this pull request can be a good start for two wagtailtrans improvements:

But the PR implementation is not polished enough to implement both correctly.

The current setup of wagtailtrans is depending heavily on TranslatablePage queries:

This makes sense as pages are stored in a tree and other objects (like snippets are not) and how it's solved now.

So I suggest that this pull request should focus on the first improvement (Create a own TranslatablePage model with just inheriting from Page and TranslatablePageMixin).

Therefore we need to make the TranslatablePage model pluggable, just like the WAGTAILIMAGES_IMAGE_MODEL in wagtail with a setting. Then we could use this mechanism to use own Page models with the Mixin.

Therefore I would rename the mixin to TranslatablePageMixin so it's more clear what it is doing.

The second step is to make snippets and other objects translatable, but that could be a next step feature in another pull request.

@mikedingjan Your thoughts on this?

maerteijn commented 4 years ago

Closed pull request due to lack of interest