[Mediawiki-i18n] How do I find out on client-side whether the current language uses genders?

Amir E. Aharoni amir.aharoni at mail.huji.ac.il
Sun Apr 20 11:35:49 UTC 2014


I wouldn't do it per language, even though there are languages that hardly
ever need gender, such as Hungarian ;)

Perhaps it could be done per message - to have a function somewhere in
jqueryMsg that quickly checks whether the parsed message would actually be
different for different genders, and if it would be the same then not to do
the API call. I guess that a simple regex that checks whether a message has
a GENDER clause with more than one parameter is enough, but I might be
wrong.


--
Amir Elisha Aharoni · אָמִיר אֱלִישָׁע אַהֲרוֹנִי
http://aharoni.wordpress.com
‪“We're living in pieces,
I want to live in peace.” – T. Moore‬


2014-04-20 7:28 GMT+03:00 Gergo Tisza <gtisza at wikimedia.org>:

> On Sat, Apr 19, 2014 at 9:24 PM, Roan Kattouw <roan.kattouw at gmail.com>wrote:
>
>> Do you need the gender of the current user, or of another user?
>>
>> If you need the gender of the current user, all you need to do is
>> depend on mediawiki.user and mediawiki.jqueryMsg, then just pass
>> mw.user (the user object) as the parameter to {{GENDER:$1|...}}. If
>> you need the gender of a different user, I'm not sure that's even
>> available.
>
>
> I need the gender of a different user (the one who uploaded a given image
> - not even necessarily a user on the same wiki). It is available via the
> users API, [1] what I need to know is whether it is necessary.
>
>
> [1] https://www.mediawiki.org/wiki/API:Users
>
> _______________________________________________
> Mediawiki-i18n mailing list
> Mediawiki-i18n at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-i18n
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wikimedia.org/pipermail/mediawiki-i18n/attachments/20140420/7b6345ed/attachment.html>


More information about the Mediawiki-i18n mailing list