localePage markup returns duplicated prefixes
snipiba opened this issue · 1 comments
snipiba commented
I found a strange behaviour on twig markup from RainLab::Translate, when you tried to localize page url with markup |localePage ...
currently used as:
{{ 'file/name'|localePage(this.site.locale, { slug: 'my-slug-for-page' }) }}
this will output on default language (without configured "prefix") correct url
on translated page url with duplicated prefix ..
for example:
// english
/store/detail/my-slug-for-page
// slovak (defined prefix /sk -> Use a CMS route prefix)
/sk/sk/obchod/detail/moj-slug-pre-page
// czech
/cz/cz/obchod/detail/muj-slug-pro-page
snipiba commented
Not sure, if this "localePage" is still a thing, because i found (probably) solution with definition of slug to be indexed..
in model:
$translatable = [
...,
[ 'slug', 'index' => true]
];
which resolve problem, but there is no need for use |localePage
just using |page
...
and, of course, needed to rename slug and return back, to recreate index for that slug.
and, of course, all searching must be YourModel::transWhere()
...