Template:SUBPAGENAME-translation
This template returns the last non-language-tag subpage name.
On normal and translatable pages (base pages where the Translate extension is activated) it returns the magic word {{SUBPAGENAME}}, but it returns the second last subpage name on translated pages (which results in being the same name on translatable and translated pages).
Examples
edit- On "Example/Page" it will return "Page"
- On "Example/Page/fi" it will return "Page"
Caveats
editThere could be false positives if some last-subpage-parts appear to be language codes, so you should be relatively confident about the expected page names.
- On "Example/Page/bar" it will return "Page" because
bar
is the language code for Bavarian. - On "Example/Page/doc" it will return "doc", but it could (and perhaps should) return "Page" in the future because
doc
is the language code for Northern Dong.
Internals
edit- This template uses Module:Template translation (function
getLanguageSubpage
) - This template doesn’t need to be translated.