PLURAL in mw.msg

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

PLURAL in mw.msg

Jeroen De Dauw-2
Hey,

I have this message: Removed $1 {{PLURAL:$1|shape|shapes}}

This message is used in JavaScript via mw.msg() to create an edit summary.
Unfortunately this summary is showing up without the PLURAL function being
rendered:
https://user-images.githubusercontent.com/146040/65845180-6cd43b80-e339-11e9-9fb3-12642a835aa0.png

The docs state that PLURAL is supported in JS:
https://www.mediawiki.org/wiki/Manual:Messages_API#Feature_support_in_JavaScript.
I've also tried mw.message('my-key').parse() and some variants of that,
though these all gave me the same result.

Why is this not working and how can I fix it?

Cheers

--
Jeroen De Dauw | www.EntropyWins.wtf <https://EntropyWins.wtf> |
www.Professional.Wiki <https://Professional.Wiki>
Entrepreneur | Software Crafter | Speaker | Open Souce and Wikimedia
contributor
~=[,,_,,]:3
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: PLURAL in mw.msg

Brian Wolff
I think you need to load mediawiki.jqueryMsg module otherwise these
interfaces do totally different things.

Personally im not really a fan of this as i dont like the idea that methods
randomly change meaning based on what modules are loaded, but it is what it
is.

--
Bawolff


On Sunday, September 29, 2019, Jeroen De Dauw <[hidden email]>
wrote:

> Hey,
>
> I have this message: Removed $1 {{PLURAL:$1|shape|shapes}}
>
> This message is used in JavaScript via mw.msg() to create an edit summary.
> Unfortunately this summary is showing up without the PLURAL function being
> rendered:
> https://user-images.githubusercontent.com/146040/
> 65845180-6cd43b80-e339-11e9-9fb3-12642a835aa0.png
>
> The docs state that PLURAL is supported in JS:
> https://www.mediawiki.org/wiki/Manual:Messages_API#
> Feature_support_in_JavaScript.
> I've also tried mw.message('my-key').parse() and some variants of that,
> though these all gave me the same result.
>
> Why is this not working and how can I fix it?
>
> Cheers
>
> --
> Jeroen De Dauw | www.EntropyWins.wtf <https://EntropyWins.wtf> |
> www.Professional.Wiki <https://Professional.Wiki>
> Entrepreneur | Software Crafter | Speaker | Open Souce and Wikimedia
> contributor
> ~=[,,_,,]:3
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: PLURAL in mw.msg

Jeroen De Dauw-2
Hey Bawolff,

Including mediawiki.jqueryMsg fixed the issue. Thanks a bunch!

I concur this is rather peculiar design. It'd be helpful to have some
indication of this in the method docs of the mw.msg() code.

Cheers

--
Jeroen De Dauw | www.EntropyWins.wtf <https://EntropyWins.wtf> |
www.Professional.Wiki <https://Professional.Wiki>
Entrepreneur | Software Crafter | Speaker | Open Souce and Wikimedia
contributor
~=[,,_,,]:3
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: PLURAL in mw.msg

Krinkle
On Wed, 2 Oct 2019 at 03:17, Jeroen De Dauw <[hidden email]> wrote:

>
> Including mediawiki.jqueryMsg fixed the issue. Thanks a bunch!
>
> I concur this is rather peculiar design. It'd be helpful to have some
> indication of this in the method docs of the mw.msg() code.


It is documented in the block for message.text() and message.parse(), with
mw.msg() being a shortcut for message.text(). Could be improved to mention
there directly as well!

-- Krinkle

https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.Message-method-text

https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.Message-method-parse

https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw-method-msg
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l