Page MenuHomePhabricator

Allow nesting translate tag inside tvar content
Open, LowPublicFeature

Description

Hi!

It would be nice if we could use translate variables (tvar) just like templates. It would be particularly useful for marking a page containing ref tags or templates.

I mean

<translate>
This is a text content<tvar name="ref"><ref><translate>This is a ref content</translate></ref></tvar> which contains some ref tags.
</translate>

In fact, a recursive parsing would probably be needed, because we might want put <tvar> inside <translate> inside <tvar> inside <translate>…
But just a second level would already be a really nice improvement! =)

Event Timeline

DannyS712 renamed this task from [improvement] allow to include translate tag inside tvar content to Allow nesting translate tag inside tvar content.Mar 22 2020, 9:15 PM
DannyS712 changed the subtype of this task from "Task" to "Feature Request".
DannyS712 awarded a token.

m:Template:Tmpl can be used as a workaround for the time being:

{{tmpl
|0=<translate>This is a text content<tvar name="ref"><ref>$1</ref></tvar> which contains some ref tags.</translate>
|1=<translate>This is a ref content</translate>
}}

And it can easily be made recursive by simply using {{tmpl}}s within {{tmpl}}s.

There is a simple native workaround I forgot, for <ref> use case:

<translate>
This is a text content<tvar name="ref"><ref name="ref1" /></tvar> which contains some ref tags.
</translate>

<references>
<ref name="ref1"><translate>This is a ref content</translate></ref>
</references>

The drawback of that is that the footnote text is at the end of the page (both when editing the source page text and when translating on Special:Translate), so people might lose the context.