Steps to reproduce
- Go to https://www.mediawiki.org/w/index.php?title=User:APatro_(WMF)/T254484&oldid=4108812&useparsoid=0
- Notice that the last line is Pew Pew en
- Now go to https://www.mediawiki.org/w/index.php?title=User:APatro_(WMF)/T254484&oldid=4108812&useparsoid=1
Actual result
- The last line is Pew Pew Template:TRANSLATIONLANGUAGE
Expected result
- The last line is still Pew Pew en
Other information
In the legacy parser, Translate replaces occurrences of {{TRANSLATIONLANGUAGE}} with the page language (the same as the output of {{PAGELANGUAGE}}) except that:
- This replacement happens only on pages that include <translate, otherwise the processing doesn’t run at all.
- This replacement happens only when this magic word-like thing is present directly on the page, as the replacement happens in the ParserBeforeInternalParse hook handler, i.e. before templates are expanded. This is not a problem because:
- This replacement happens on translation pages (e.g. Foo/en or Foo/de) when they are generated, not when they are parsed (using a more complex logic, but the Parsoid implementation doesn’t need to know about that).
In all other cases, Translate doesn’t touch this magic word-like thing, so it’s handled by the parser, which treats it as a template (since it’s not a real magic word).