Page MenuHomePhabricator

User interface HTML elements don't use lang attribute
Closed, ResolvedPublic


Author: muke

If the user has changed their interface language in
Special:Preferences, then all elements affected by
this should advertise themselves (by lang="xx",
etc.) to be in the selected language.

Current behaviour is that the whole page is marked
as being in the default language of the wiki, even
when the wiki 'knows' it is also returning data in
another language.

Version: unspecified
Severity: normal
See Also:



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:42 PM
bzimport set Reference to bz2865.
bzimport added a subscriber: Unknown Object (MLST).

Messages can be in (various) fallback languages even if
a user did not select a non-standard interface language.
Also those deserve proper language tagging.

lang attribute added in various places in r49331 (with some fixes in r49350 and r51448).

Isn't this essentially fixed by the new better directionality code?

(In reply to comment #4)

Isn't this essentially fixed by the new better directionality code?

I think that it's done, except for the page title (<h1 id="firstHeading" class="firstHeading">).

This solution generates the wrong language when the first heading contains a system message in user interface language: contains
<h1 lang="ar" class="firstHeading" id="firstHeading"><span dir="auto">Editing الصفحة الرئيسية</span></h1> contains
<h1 lang="en" class="firstHeading" id="firstHeading"><span dir="auto">Pages that link to "الصفحة الرئيسية"</span></h1>

In both situations the attribute lang isn't necessary because <html lang="en"> already exists.

I guess we could split it into two titles. UI title vs. Content title bits. Requires a bit more work.

I suggest to open a separate ticket on this front.