Page MenuHomePhabricator

MediaWiki:Mwe-upwiz-mins-secs-remaining needs plural support: add $3 = $1 + $2
Closed, ResolvedPublic

Description

Author: michael.moroni

Description:
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

Version: unspecified
Severity: normal
URL: http://translatewiki.net/w/i.php?title=MediaWiki:Mwe-upwiz-mins-secs-remaining/eo&oldid=2227403

Details

Reference
bz24643

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:59 PM
bzimport added projects: UploadWizard, I18n.
bzimport set Reference to bz24643.

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?

michael.moroni wrote:

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

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.

Aside from this working or not working, no non-core parser functions should use used in MediaWiki default core messages whatsoever.

michael.moroni wrote:

(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.

(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.

@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 ?

(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.)

michael.moroni wrote:

(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.

(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.

Isn't this more about i18n than UploadWizard?

(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.

(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

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

Change 78372 merged by jenkins-bot:
Complete PLURAL support in mwe-upwiz-mins-secs-remaining

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

Gilles raised the priority of this task from Medium to Unbreak Now!.Dec 4 2014, 10:23 AM
Gilles added a project: Multimedia.
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Medium.Dec 4 2014, 11:21 AM