Skip to content

Restrict translations to namespace with default language installation result in bad translation links #61

Open
@gentakojima

Description

@gentakojima

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions