Page MenuHomePhabricator

[minor] wmf.11-regression: changesLimitButtonWidget does not display "Number of edits to show by default: 1"
Closed, ResolvedPublic

Description

  1. On Preferences-Recent changes, a user selects Number of edits to show by default: 1
  2. On RC page, the number of edits will not be displayed:

Screen Shot 2017-12-06 at 11.58.32 AM.png (204×1 px, 42 KB)

Previous to wmf.11 Number of edits to show by default: 1 was accommodated:

Screen Shot 2017-12-06 at 11.57.53 AM.png (173×1 px, 42 KB)

Note 1: Surprisingly, Number of edits to show by default: 0 is displayed fine:

Screen Shot 2017-12-06 at 11.59.41 AM.png (207×1 px, 22 KB)

Note 2: Watchlist has the same issue, of course.

Event Timeline

Etonkovidova renamed this task from [minor] wmf.11-regression to [minor] wmf.11-regression: changesLimitButtonWidget does not display "Number of edits to show by default: 1" .Dec 6 2017, 8:11 PM
Etonkovidova added a project: Regression.

Yes, there's a funny (not) bug/feature in mw.msg regarding treating the number 0 as plural, so {{PLURAL:$1|change|$1 changes}} will be 'change' if it's only one, and '0 changes' if it's zero or bigger than 1. I'm not 100% sure, but I think we tried a variation {{PLURAL:$1|0=no changes|1=one change|$1 changes}} and that didn't work right, but I might be wrong, and this could be a solution.

We can rephrase the sentence, perhaps, to allow for showing "1 change" specifically for 1. Also, 0 changes should probably be normalized to 1, since showing nothing makes no sense,but if the previous system (and backend) allow for it, I guess we can leave that as is.

(Note: I was originally thinking of T170975: {{PLURAL}} behaves differently in PHP vs JS for decimal numbers but this is a different issue than the one in this ticket)

Yes, there's a funny (not) bug/feature in mw.msg regarding treating the number 0 as plural, so {{PLURAL:$1|change|$1 changes}} will be 'change' if it's only one, and '0 changes' if it's zero or bigger than 1.

This is not a bug in mw.msg/jQueryMsg. It is correct English, and the same in the PHP message system. It turns out jQueryMsg/mw.language gets the plural rules directly from the server (not tested, but languages where 0 is not plural should work correctly).

I'm not 100% sure, but I think we tried a variation {{PLURAL:$1|0=no changes|1=one change|$1 changes}} and that didn't work right, but I might be wrong, and this could be a solution.

The general rule is to spell numbers "one" through "nine", then go to "10", etc. Of course, that's a pain for software, so I think it's best to just stick to "1", "2", etc.

I don't object to "No changes", but the description doesn't request that, so I'll just stick to "0 changes" for now.

We can rephrase the sentence, perhaps, to allow for showing "1 change" specifically for 1.

+1

Change 402177 had a related patch set uploaded (by Mattflaschen; owner: Mattflaschen):
[mediawiki/core@master] RCFilters: Fix 1 change

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

Change 402177 merged by jenkins-bot:
[mediawiki/core@master] RCFilters: Fix limit display for limit=1

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

Checked the fix in testwiki wmf.20

Screen Shot 2018-02-06 at 3.28.42 PM.png (264×405 px, 36 KB)