Page MenuHomePhabricator

Should be able to specify language of a page title that is not in the same language as the wiki, without using HTML tags
Closed, DeclinedPublic

Description

Consider for example, the English-Wikipedia page:

https://en.wikipedia.org/wiki/L'esprit_de_l'escalier

whose title is in the French language. The wiki-markup of the lede includes, correctly:

{{lang|fr|L'esprit de l'escalier}}

which produces the HTML:

<span xml:lang="fr" lang="fr">L'esprit de l'escalier</span>

However, there is no way to indicate that the level 1 heading (i.e. the page title) is in French, and it is rendered as:

<h1 id="firstHeading" class="firstHeading assess-start-text" lang="en"><i>L'esprit de l'escalier</i>[...]</h1>

there should be some way to set the language on that heading.

Event Timeline

I think you can just use {{DISPLAYTITLE:...}} for this? Does that not work?

It seems that:

{{DISPLAYTITLE:''<span lang="fr>L'esprit de l'escalier</span>''}}

works, after a fashion, producing:

<h1 id="firstHeading" class="firstHeading assess-start-text" lang="en"><i><span lang="fr">L'esprit de l'escalier</span></i>[...]</h1>

but:

{{DISPLAYTITLE:''{{lang|fr|L'esprit de l'escalier}}''}}

does not.

There is actually a very helpful warning on preview with {{DISPLAYTITLE:''{{lang|fr|L'esprit de l'escalier}}''}}:

Warning: Display title "<i><span lang="fr">L'esprit de l'escalier</span>[[Category:Articles containing French-language text]]</i>" was ignored since it is not equivalent to the page's actual title.

So… basically, DISPLAYTITLE doesn't handle wikitext links (or more specifically categories, but I think the problem is with links in general). I'm not really sure if DISPLAYTITLE is supposed to handle them.

@Pigsonthewing Given that this is fundamentally possible, I think we can close this task?

Given that this is fundamentally possible, I think we can close this task?

I don't know - do we think it OK to require editors to use raw HTML?

matmarex renamed this task from Should be able to specify language of a page title that is not in the same language as the wiki to Should be able to specify language of a page title that is not in the same language as the wiki, without using HTML tags.Jul 5 2017, 10:16 PM
matmarex unsubscribed.

I would say when the template does not automatically add a category it works.

Izno subscribed.

You can remove the category from {{lang}} with |nocat=true on en.wp currently (and I think even before it was Lua-fied you could do that). So there's a way to do it with wikitext.