Last modified: 2013-11-22 15:59:00 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T44497, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42497 - newmessageslinkplural and newmessagesdifflinkplural shouldn't use fake values for the number of changes
newmessageslinkplural and newmessagesdifflinkplural shouldn't use fake values...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Internationalization (Other open bugs)
1.21.x
All All
: Normal normal (vote)
: 1.23.0 release
Assigned To: Nobody - You can work on this!
gci2013 https://www.mediawiki.org/wik...
: easy, i18n
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-28 11:00 UTC by Bartosz Dziewoński
Modified: 2013-11-22 15:59 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bartosz Dziewoński 2012-11-28 11:00:48 UTC
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
Comment 1 Liangent 2012-11-28 11:05:36 UTC
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.
Comment 2 Lupo 2012-12-04 12:39:31 UTC
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.
Comment 3 Niklas Laxström 2012-12-04 13:14:59 UTC
Just use the new {{PLURAL:$1|1=one message|messages}} syntax and some random big other number for non-one count.
Comment 4 Bartosz Dziewoński 2012-12-13 11:56:44 UTC
I submitted changeset 38506 to fix this issue (per my idea described in first post).
Comment 5 Bartosz Dziewoński 2012-12-13 11:57:22 UTC
(That would be I10edba3c, dunny why it wasn't autolinked.)
Comment 6 Bartosz Dziewoński 2013-02-13 18:49:42 UTC
Abandoned per Niklas's and Siebrand's comments.
Comment 7 Gerrit Notification Bot 2013-11-20 22:13:07 UTC
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
Comment 8 Gerrit Notification Bot 2013-11-22 15:18:01 UTC
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
Comment 9 Bartosz Dziewoński 2013-11-22 15:59:00 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links