Page MenuHomePhabricator

newmessageslinkplural and newmessagesdifflinkplural shouldn't use fake values for the number of changes
Closed, ResolvedPublic

Description

newmessageslinkplural and newmessagesdifflinkplural (introduced in I8870111802 to fix bug 12701) both have a single parameter, that one could expect to be the number of or (respectively) messages or changes. However, this parameter can only take values of '1' (when there's one message/change) or '2' (when there are more). While this behavior is documented, it's obviously confusing, and I just had to fix translations of these messages to Polish[1][2].

As I assume obtaining correct values is impossible (too database-intensive?), both messages should be split into two – one for singular and one for plural form. If this is considered such a very bad practice, then at least we should usea different value than '2' to make errors in translations more obvious – '999' would do.

[1] http://translatewiki.net/w/i.php?title=MediaWiki:Newmessageslinkplural/pl&diff=prev&oldid=4351303
[2] http://translatewiki.net/w/i.php?title=MediaWiki:Newmessagesdifflinkplural/pl&diff=prev&oldid=4351311


Version: 1.21.x
Severity: normal
Whiteboard: gci2013 https://www.mediawiki.org/wiki/Google_Code-In#Candidate_tasks

Details

Reference
bz42497

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:02 AM
bzimport set Reference to bz42497.
bzimport added a subscriber: Unknown Object (MLST).

Hmm I didn't know that, and many others neither.

https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Newmessagesdifflinkplural/en

We should clean up all translations, I guess.

Yeah, that could be improved. The point is that while we know the number of edits, that not necessarily is the number of messages. One edit != one message.

We may reasonably assume that if there was one edit, it was one message. But if there's a second edit, we don't know if that's some amendment of that message, or a new message, or what. Hence any counting we might do is not quite right and thus came about this one/several distinction. It could be easily changed to 999, if that is more appropriate for the translators (as a quick fix). Or the message text could just ignore $1 altogether and always use the plural ("messages").

Some day I guess I'll have to sit down and re-think the way these messages are constructed and assembled.

Just use the new {{PLURAL:$1|1=one message|messages}} syntax and some random big other number for non-one count.

I submitted changeset 38506 to fix this issue (per my idea described in first post).

(That would be I10edba3c, dunny why it wasn't autolinked.)

Abandoned per Niklas's and Siebrand's comments.

Change 96652 had a related patch set uploaded by MegaAlex:
Change the syntax and non-one count fake values for {{PLURAL: in newmessages*

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

Change 96652 merged by jenkins-bot:
Change the syntax and non-one count fake values for {{PLURAL: in newmessages*

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

I'm going to call the current state "Good Enough" and close this. I'd still prefer doing this the way I wanted to in my previous patch (comment 5), but this is a clear improvement.