Closed Ladylain closed 4 years ago
@Ladylain I feel like this is a problem with the Excodus.TranslateExtended plugin
@LukeTowers i've just finished to test this bug on another project and it seems that all works fine. The second project have also Excodus.TranslateExtended plugin
I don't know why this is not working for now, i'm investigating.
@LukeTowers you can close this issue ! i've found the solution. It was my mistake, i have a lot of code in my plugin and i was doing this :
// Check if we are currently in backend module.
if (!App::runningInBackend()) {
return;
}
Event::listen('translate.localePicker.translateParams', function($page, $params, $oldLocale, $newLocale) {
if ($page->baseFileName == 'single-actualite') {
return Article::translateParams($params, $oldLocale, $newLocale);
}
});
so, unless i was on the backend the listener could not work. :(
Event::listen('translate.localePicker.translateParams', function($page, $params, $oldLocale, $newLocale) {
if ($page->baseFileName == 'single-actualite') {
return Article::translateParams($params, $oldLocale, $newLocale);
}
});
// Check if we are currently in backend module.
if (!App::runningInBackend()) {
return;
}
sorry for wasting your time, and thanks for your help
best,
Hi
OctoberCMS : version 464 PHP : 7.2.19 Plugins :
Issue
I have a model named
Article
where I have a translatableSlug
I use CMSPage to display an Article with the Slug as URL parameter.I'm using the Extended Locale Picker from Excodus.TranslateExtended plugin, this one just extends Rainlab.Translate plugin.
What i'm trying to have is to display the translated slug in the URL when i'm switching language from the picker.
I've read the documentation of Rainlab.Translate plugin and add this snippet to my Plugin.php
and add this one to my model :
but when i switch language the URL parameter is not translated and moreover, if i try to access the page with the translated URL parameter directly, it returns me "Record not found"
Can someone have a solution to fix this ?
Best,