Open gentakojima opened 10 years ago
You're right, this feature seems to be totally broken. I might decide to remove it completely to save me some headaches...
You're right, this feature seems to be totally broken. I might decide to remove it completely to save me some headaches...
I found that quite helpful, ig it would work properly. But to the fix from @gentakojima what to change exactely? I found the function in helper.php
public function buildTransID($lng, $idpart) { if ($lng && in_array($lng, $this->translations)) { $link = ':' . $this->translationNs . $lng . ':' . $idpart; $name = $lng; } else { $link = ':' . $this->translationNs . $idpart; $name = $this->realLC(''); } return array($link, $name); }
but as I don't have any idea of programming (anymore - I did some BASIC, qBASIC, VisualBasic - but PHP and everything else is foreign to me) I do not know what exactely to change/replace there.
Maybe you could also include that fix on the Plugin-Page https://www.dokuwiki.org/plugin:Translation
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 thebuildTransID
function to this:preg_replace("/^{$this->tns}/", "", $idpart)