Translate indexed slugs for alternate hrefs
1
This trick is no longer required as it is now included in RainLab.Translate by default:
https://github.com/rainlab/translate-plugin/commit/c9e4032d443c4f066ffefc3815adab0db5222d16
___
Currently, URLs with indexed slugs do not get translated in the AlternateHrefLangElments-component of the rainlab translate-plugin. To enhance the component with this functionality, just add the following class and lines to the component.
use Illuminate\Support\Facades\Event;
// ...
$translatedParams = Event::fire('translate.localePicker.translateParams',
[$page, $params, $this->oldLocale, $locale], true);
if ($translatedParams) {
$params = $translatedParams;
}
If you want to use this functionality it is necessary that you have implemented the url parameter translation of the plugin. See https://github.com/rainlab/translate-plugin#url-parameter-translation.
There are no comments yet
Be the first one to comment