Page MenuHomePhabricator

Invalid language codes should fallback to default wiki language not English
Closed, DeclinedPublic

Description

Current behavior:

When trying to view a page by entering an invalid language code in the "uselang=" parameter, the wiki fallbacks to English.

Desired behavior:

When trying to view a page by entering an invalid language code in the "uselang=" parameter, the wiki fallbacks to the default language set for the wiki.

Example to illustrate (see URL):

In the French (fr) Wikipedia, when trying to view recent changes by entering abc as a language code (there is no language whose code is abc), the wiki fallbacks to English. In fact it should fallback to French (default language in wiki).


Version: unspecified
Severity: enhancement
URL: http://fr.wikipedia.org/wiki/Special:Modifications_r%C3%A9centes?uselang=abc

Details

Reference
bz13010

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 10:06 PM
bzimport set Reference to bz13010.
bzimport added a subscriber: Unknown Object (MLST).

Created attachment 4652
Fixes the mentioned bug

This patch allows trying to fall back to the content language, before an effort to falling back to 'en'. I'm not applying it, because I both need it to be reviewed, and think acceptance of some more experienced developers is needed about such a change in the behaviour of wiki software.

Attached:

Marking for review. Also, I want to credit Alexandre Emsenhuber (ialex) for his helping me finding where to fix. :)

Created attachment 4653
other version

other patch to fix that bug, does not throw an exception when the content language code is invalid.

Attached:

VasillievVV,

The reason we didn't apply the second patch was that it didn't include the error logging features which were available in the first patch, although it was more straightforward. I didn't get the time to make a third patch which combines the two.

I guess I'm going to add the debugging features right to the code, if you don't do it sooner than me.

I see no good motivation for this change, and the commons would need a alternative way for their hack for this be changed.

I just checked with Krinkle; the patch had nothing wrong -- Commons is the one using uselang in a nonstandard way. The best approach would be to implement a different setup for the Special:Upload customization, but since the new uploader is coming around, we just need to wait until the current one is superseded and then this patch can be safely applied. I'm marking the bug as "fix later" rather than "wontfix".

(In reply to comment #9)

Has LATER arrived?

I suppose... is the new uploader the default for everyone in Commons now? I know I got it last time I uploaded a file.

(In reply to comment #10)

(In reply to comment #9)

Has LATER arrived?

I suppose... is the new uploader the default for everyone in Commons now? I
know I got it last time I uploaded a file.

This doesn't seem enough for the old system to be dropped. There's still no way to get the same customisation on wiki.

Switching from LATER to the second most relevant resolution for fear of information loss. http://article.gmane.org/gmane.science.linguistics.wikipedia.technical/65116