Page MenuHomePhabricator

Fix "Simple English" language querying en.wikipedia.org instead of simple.wikipedia.org
Closed, ResolvedPublic2 Estimated Story Points

Event Timeline

JGirault raised the priority of this task from to High.
JGirault updated the task description. (Show Details)
JGirault added subscribers: MSyed, Ironholds, JGirault and 3 others.

Hi! Can a description be put in here? Thanks!

Change 269134 had a related patch set uploaded (by Jdrewniak):
Switches the lang value for Simple English from 'en' to 'simple'.

https://gerrit.wikimedia.org/r/269134

@Jdrewniak I added my comment here, but to make sure it is visible:

I am not sure about this change.
It seems that it was done intentionally.
I tried to find some more documentation: https://meta.wikimedia.org/wiki/Special_language_codes#Subdomains_that_do_not_match_the_lang_attribute
https://meta.wikimedia.org/wiki/List_of_Wikipedias#Languages_without_ISO_639_language_code_or_duplicated_or_using_incorrect_code
https://meta.wikimedia.org/wiki/Wikipedia/Versions
But they sort of fail to explain that "simple english" wiki needs lang="en" as parameter.
Nonetheless, the bug actually happens on the *new* search box *only*, so we probably don't want to fix this here, but in the new search box code instead.

The way it works on the old language selector is that the option looks like this

<select name="language">
    <option value="simple" lang="en">Simple English</option>
</select>

So that the form gets submitted with the values language=simple and the lang attribute is used for accessibility purposes only.

The problem with the new selector is that it sets the lang attribute ('en') as the value, instead of the data-lang-value attribute: https://github.com/wikimedia/wikimedia-portals/blob/search-box/dev/wikipedia.org/assets/js/wm-portal.js#L714 In all cases except 'simple english' and this one ^1 , those two values are the same.

Given that @JGirault will be reworking the language picker for T125571 this fix can be factored into that work.


  1. I checked and for the Min Nan Wikipedia , http://nan.wikipedia.org redirects to http://zh-min-nan.wikipedia.org, so this issue only occurs for the simple english wikipedia.
This comment was removed by Jdrewniak.

Change 269134 abandoned by Jdrewniak:
Switches the lang value for Simple English from 'en' to 'simple'.

Reason:
language picker will be reworked.

https://gerrit.wikimedia.org/r/269134

Closing this - looking good!