Topic on Help talk:Extension:Translate

Using current page language instead of Special:MyLanguage for links

3
C schmitz (talkcontribs)

Hello,

we have been using syntax like this for links

[[Special:MyLanguage/Getting Started|<translate>[[Special:MyLanguage/Getting Started|<translate><!--T:55--> Getting Started</translate>]]</translate>]]

But the problem is that if the user clicks any link it will redirect to the user language, not the current document language. Is there a way to use something like

[[Getting Started/{{TRANSLATIONLANGUAGE}}|<translate>Getting Started</translate>]]<translate><!--T:55--> Getting Started</translate></translate>]]

I saw that with this commit https://phabricator.wikimedia.org/rETRA5e8106cdc353294bb97b626fbd1bf46c860ebb02 it was introduced but cannot find it in the current release.


TLDR: I want easily maintainable links which automatically point to the page of the current document language, NOT user language.


Any insight would be very helpful.

Thank you in advance. C schmitz (talk) 18:36, 25 October 2021 (UTC)

Nikerabbit (talkcontribs)

{{TRANSLATIONLANGUAGE}} only works inside translation units, and is probably not what you want anyway. You can hardcode links to [[TargetPage/{{PAGELANGUAGE}}]] if you don't mind about links pointing to non-existent pages when translation is missing.

C schmitz (talkcontribs)

Thank you. It would be nice to have such an operator that, if needed, falls back to the base language, if no translation exists yet.

Reply to "Using current page language instead of Special:MyLanguage for links"