Last modified: 2013-09-10 22:44:26 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 T26643, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 24643 - MediaWiki:Mwe-upwiz-mins-secs-remaining needs plural support: add $3 = $1 + $2
MediaWiki:Mwe-upwiz-mins-secs-remaining needs plural support: add $3 = $1 + $2
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
UploadWizard (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nemo
http://translatewiki.net/w/i.php?titl...
: i18n
Depends on:
Blocks: plural
  Show dependency treegraph
 
Reported: 2010-08-03 09:23 UTC by Michael Moroni
Modified: 2013-09-10 22:44 UTC (History)
6 users (show)

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


Attachments

Description Michael Moroni 2010-08-03 09:23:19 UTC
Hi you all, I want you to see this problem (http://translatewiki.net/w/i.php?title=MediaWiki:Mwe-upwiz-mins-secs-remaining/eo&oldid=2227403):
I have to translate that sentence but "remaining" in esperanto needs the plural form if the number is plural. So I used an ifexpr in order to see if remains 1 minute or one second (minute + second = 1 means that 1 minute or 1 second remains). But variables are inserted in the way $n (don't know if it is PHP or other language), not supported by parser functions. Could you fix this problem?
Thank you,
- Michael
Comment 1 Roan Kattouw 2010-08-04 11:11:36 UTC
How is $n not supported by parser functions? {{PLURAL:$1|foo|bar}} works just fine. Could you provide a more concrete example of code that fails?
Comment 2 Michael Moroni 2010-08-04 11:16:28 UTC
Here the example in the translated message (http://translatewiki.net/w/i.php?title=MediaWiki:Mwe-upwiz-mins-secs-remaining/eo&oldid=2227403): {{#ifexpr:$1 + $2|1|restanta|restantaj}}
It needs to provade the plural case of "left": if there is 1 minute or one second, ifexpr will show "restanta", if not "restantaj", because "minutes + seconds = 1" means that or minutes=1 and seconds=0 or minutes=0 and seconds=1.
Did you understand?
- Michael
Comment 3 Roan Kattouw 2010-08-04 11:22:20 UTC
OK, so how does that fail? There's an expression error on the linked page, but that doesn't mean anything: the expression is indeed invalid until the real numbers are substituted for $1 and $2, at which point it should work.
Comment 4 Siebrand Mazeland 2010-08-04 11:39:57 UTC
Aside from this working or not working, no non-core parser functions should use used in MediaWiki default core messages whatsoever.
Comment 5 Michael Moroni 2010-08-04 11:49:28 UTC
(In reply to comment #3)
> OK, so how does that fail? There's an expression error on the linked page, but
> that doesn't mean anything: the expression is indeed invalid until the real
> numbers are substituted for $1 and $2, at which point it should work.

I hope! Is it possible to "hide" the error?

(In reply to comment #4)
> Aside from this working or not working, no non-core parser functions should use
> used in MediaWiki default core messages whatsoever.

Why? It is needed to make plural form! Otherwise I don't know how to make a grammatically correct sentence.
Comment 6 Nemo 2012-07-28 20:54:24 UTC
(In reply to comment #5)
> Why? It is needed to make plural form! Otherwise I don't know how to make a
> grammatically correct sentence.

You need a third parameter.
Comment 7 Derk-Jan Hartman 2012-11-09 07:48:02 UTC
@nemo: you mean a third parameter needs to be added to MediaWiki:Mwe-upwiz-mins-secs-remaining in order to support plural for "remaining" word in this message, because sometimes it depends on $1 + $2 ?
Comment 8 Nemo 2012-11-09 08:01:34 UTC
(In reply to comment #7)
> @nemo: you mean a third parameter needs to be added to
> MediaWiki:Mwe-upwiz-mins-secs-remaining in order to support plural for
> "remaining" word in this message, because sometimes it depends on $1 + $2 ?

Yes. If I understand correctly how the translator wants to use it, it's a correct usage of plural for Esperanto.

(In other languages, to achieve the same reliably you'd need to use a second message or the new plural syntax, see the recent http://laxstrom.name/blag/2012/10/29/muir-woods-has-one-tree-plural-issues-in-mediawiki/ . This single message is not quite ideal even in English, if it displays things like "0 minutes and 30 seconds" etc.)
Comment 9 Michael Moroni 2012-11-09 09:58:30 UTC
(In reply to comment #8)
> or the new plural syntax

I read the example (OMG) and I think that it shouldn't work: it's not depending on a single variable but on the sum of two variable (1+0=1 (one minute and no seconds) or 0+1=1 (no minutes and one second)).
I think that the only one correct solution in order to render a grammatically correct sentence in Esperanto is the #ifexpr way.
Otherway I suggest you too change the sentence but I think that there is no way to render this sentence in another way without having problem in Esperanto translation.
Comment 10 Nemo 2012-11-09 10:08:13 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > or the new plural syntax
> 
> I read the example (OMG) and I think that it shouldn't work: it's not depending
> on a single variable but on the sum of two variable (1+0=1 (one minute and no
> seconds) or 0+1=1 (no minutes and one second)).

Of course it would work only after the third parameter is implemented.

> I think that the only one correct solution in order to render a grammatically
> correct sentence in Esperanto is the #ifexpr way.

No. Period. See above.
Comment 11 Nischay Nahata 2013-02-09 17:01:05 UTC
Isn't this more about i18n than UploadWizard?
Comment 12 Nemo 2013-02-09 18:18:32 UTC
(In reply to comment #11)
> Isn't this more about i18n than UploadWizard?

I don't understand the question. It's about UW i18n. Clarified summary.
Comment 13 Nischay Nahata 2013-02-09 20:40:23 UTC
(In reply to comment #12)
> I don't understand the question. It's about UW i18n. Clarified summary.

Okay, looking at the discussion I felt its something people want to be supported by i18n. Anyways, any clear idea on how this can be achieved? or just {{PLURAL|$3|remaining...}} where $3 = $1 + $2 would do
Comment 14 Gerrit Notification Bot 2013-08-09 10:18:43 UTC
Change 78372 had a related patch set uploaded by Nemo bis:
Complete PLURAL support in mwe-upwiz-mins-secs-remaining

https://gerrit.wikimedia.org/r/78372
Comment 15 Gerrit Notification Bot 2013-09-10 22:39:12 UTC
Change 78372 merged by jenkins-bot:
Complete PLURAL support in mwe-upwiz-mins-secs-remaining

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

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


Navigation
Links