I'm restricting translations to the namespace "names". So, links look like this:
:names:page
:names:langcode1:names:page
:names:langcode2:names:page
Then, when entering a translated page, the original language link look like this:
:names:names:page
:names:langcode1:names:page
:names:langcode2:names:page
Notice that the original page link is wrong. Should be :names:page.
My proposal to fix this is to modify the function buildTransID, so the links always look like this:
:names:page
:names:langcode1:page
:names:langcode2:page
This changes the current behaviour, but also removes unneccessary bloat on the URLs.
To do this, just replace the two occurrences of $idpart in the buildTransID function to this:
preg_replace("/^{$this->tns}/", "", $idpart)
I'm restricting translations to the namespace "names". So, links look like this:
:names:page:names:langcode1:names:page:names:langcode2:names:pageThen, when entering a translated page, the original language link look like this:
:names:names:page:names:langcode1:names:page:names:langcode2:names:pageNotice that the original page link is wrong. Should be
:names:page.My proposal to fix this is to modify the function
buildTransID, so the links always look like this::names:page:names:langcode1:page:names:langcode2:pageThis changes the current behaviour, but also removes unneccessary bloat on the URLs.
To do this, just replace the two occurrences of
$idpartin thebuildTransIDfunction to this:preg_replace("/^{$this->tns}/", "", $idpart)