Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not append language code to slug while synchronizing translation tree #196

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mateusz-kleinert
Copy link

Hello, there is an issue created some time ago - #178 - which I believe this PR can solve.

With WAGTAILTRANS_SYNC_TREE set to True we can end up with paths like this one: /fr/products-fr/ assuming that the fr is not the default language. This is due to synchronizing translation tree algorithm which makes use of create_translation() method from TranslatablePage. As create_translation() can be used in a different contexts it tampers the slug value trying to make it unique. With WAGTAILTRANS_SYNC_TREE set to True we don't need to append language code to slug as the translated page is going to exist in a different sub-tree than the canonical page.

After some experiments I think the synchronize_trees() signal handler is the right place for a fix. However, I'd love to get some feedback and discuss alternatives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant