Topic on Extension talk:Translate

{ { subpagename}} doesnt retrieve language?

4
Summary by Nikerabbit

Recommending to use {{#titleparts}}

Dpfluegl (talkcontribs)

i want to retrieve the language of the translated page for the template to get a similar menu structure in a different language but subpagename gets the whole page title - how could i fix/workaround this?

Shirayuki (talkcontribs)

{{#translation:}} or {{pagelang}} may help you.

Dpfluegl (talkcontribs)

these arent magic words? they link to empty templates in my mw

i did a workaround with regex extension:

{ {#regex:{ {PAGENAME}}|%^.*(/.*)$%|$1}}

still appreciate "cleaner" solutions

Nikerabbit (talkcontribs)

I recommend using #titleparts magic word from Extension:ParserFunctions. The reason why {{subpagename}} does not work is that it it depends on the $wgNamespacesWithSubpages configuration setting, which is not set to true for pages in the main namespace.