Page MenuHomePhabricator

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

Description

Author: muke

Description:
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:
https://bugzilla.wikimedia.org/show_bug.cgi?id=34514

Details

Reference
bz2865

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).

Changing summary

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">).

TheDJ added a comment.Nov 14 2012, 8:50 PM

merged. not yet deployed

This solution generates the wrong language when the first heading contains a system message in user interface language:

http://ar.wikipedia.beta.wmflabs.org/w/index.php?title=%D8%A7%D9%84%D8%B5%D9%81%D8%AD%D8%A9_%D8%A7%D9%84%D8%B1%D8%A6%D9%8A%D8%B3%D9%8A%D8%A9&action=edit&uselang=en contains
<h1 lang="ar" class="firstHeading" id="firstHeading"><span dir="auto">Editing الصفحة الرئيسية</span></h1>

http://ar.wikipedia.beta.wmflabs.org/wiki/%D8%AE%D8%A7%D8%B5:%D9%85%D8%A7%D8%B0%D8%A7_%D9%8A%D8%B5%D9%84_%D9%87%D9%86%D8%A7/%D8%A7%D9%84%D8%B5%D9%81%D8%AD%D8%A9_%D8%A7%D9%84%D8%B1%D8%A6%D9%8A%D8%B3%D9%8A%D8%A9?uselang=en 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.

TheDJ added a comment.Nov 15 2012, 8:57 AM

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.