Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. Chat with us on Discord at https://discord.gg/cnWk7EFv8R.
Translations with nested modules does not pick correct slug translation for parent.
For example if i create a nested category in italian and english where parent slug translates to:
parent-it for it
parent-en for en
and create a child component with slug
child-it for it
child-en for en
on the back-end it will displayed as
parent-en/child-en for en
parent-en/child-it for it (wrong).
I also have the same problem with parend-child nested modules (ex. nested translable categories with articles)
Steps to reproduce
Create a nested module with translation, create a child node and try to switch different language.
The
Expected result
Nested modules should show slug on correct translation.
Actual result
Parent slug is not translated on language change.
Versions
Twill 3.3.1
Laravel 10/11 (tested on both)
Php 8.2/8.3
Mysql 8
Temporary solution
After a lot of fiddling i found an improvised solution
Description
Translations with nested modules does not pick correct slug translation for parent. For example if i create a nested category in italian and english where parent slug translates to:
I also have the same problem with parend-child nested modules (ex. nested translable categories with articles)
Steps to reproduce
Create a nested module with translation, create a child node and try to switch different language. The
Expected result
Nested modules should show slug on correct translation.
Actual result
Parent slug is not translated on language change.
Versions
Twill 3.3.1 Laravel 10/11 (tested on both) Php 8.2/8.3 Mysql 8
Temporary solution
After a lot of fiddling i found an improvised solution
Original code:
We will save all the translation for the permalinks and return them from
getLocalizedPermalinkBase