Jump to navigation Jump to search


Thread titleRepliesLast modified
PLURAL keyword for languages without grammatical plural forms412:00, 16 September 2012
On different plural systems701:21, 12 July 2012
Documenting plural on language portals117:53, 28 April 2012
SVN or Git?1020:30, 15 April 2012
Difference between CLDR plural rules and MediaWiki plural rules1115:01, 9 April 2012
Table of Plural/Mediawiki_plural_rules ready013:06, 9 April 2012
Russian plural314:56, 1 April 2012
Only for your information000:15, 13 March 2012
First page
First page
Next page
Next page
Last page
Last page

PLURAL keyword for languages without grammatical plural forms

At some recent point, there seemingly was a change in how the PLURAL keyword of MediaWiki works. Could anyone shed me the light what the change really is, and how we should now translate messages with PLURAL in the source language?

Here is a bit of what I understand (correct me if I'm wrong): It seems that when the site/user language is specified as Japanese, the MediaWiki function CLDRPluralRuleEvaluator.evaluateCompiled always returns 0. This means that a PLURAL keyword will always be replaced by its first argument. Gramattically, it's correct that nouns have the same form regardless of number in languages like Japanese. However, abandoning PLURAL at all causes a problem in messages such as MediaWiki:Category-article-count/ja.

PLURAL keyword seems to be used beyond just grammatical numbers. Here, the English message MediaWiki:Category-article-count/en uses PLURAL not only for switching between 'page' and 'pages', but also for deciding whether to add the part saying 'out of xx total' or not. Japanese translators here tried to literally translate it, and ended in having MediaWiki to always show the first part, corresponding to the singular case, with no information of the total number. Since most categories have multiple pages, most of the case the rendering is wrong. For instance, see how this message is rendered, on the English Wiktionary, correctly with the English interface [1] , but incorrectly with the Japanese interface [2].

What is the recommended way to translate them now? Do we want to remove all PLURAL when translating into Japanese, regardless of how it is used? If we are to throw out PLURAL for languages without grammatical plural forms, I think we'd have to review all the instances in the messages ...

whym06:20, 13 September 2012

I see the problem. It is pretty obvious from Plural/Comparison_of_plural_rules_in_various_databases where ja and ko have implicit default n != 1 rule in MW while explicit no forms rules in other sets.

Short term fix is to avoid plural in messages, in longer term I think this would be appropritately solved by supporting explicit number forms like {{PLURAL:$1|0=something special|usual text}}.

Nike (talk)16:02, 14 September 2012

Correct me if I'm wrong but this is only an issue for messages with special n=0 cases (for which we usually use different messages altogether).

Nike (talk)16:11, 14 September 2012

I can see the short term fix will work most of the case. Sometimes we'd have to choose translation a bit inconsistent to original, but the difference would be minor anyway.

I'm not sure how to check whether it's a 'n=0' case or not. If MediaWiki:badaccess-groups/ja is a non 'n=0' case, I confirm it's also affected.

whym19:53, 14 September 2012

On different plural systems

Edited by another user.
Last edit: 16:39, 10 March 2012

I made some research on the various plural systems used by projects in It compares plural rules between three main systems: MediaWiki, Gettext and CLDR (used by Ruby projects). The results are at page Plural/Comparison_of_plural_rules_in_various_databases. The most troubling part are the detailed reports after the overview. In the detailed part the plural rules are compared between all applicable systems. If there are differences, those are printed out. Can we reach out speakers of those languages to verify which ruleset (if any) is correct.

If we can sort those issues out, we can go further and try to get CLDR data as complete as possible, and have all other projects use CLDR definitions in way or another. We could for example provide extended list of plural rules (based on CLDR data with missing rules added) for all the supported projects.

Nike16:04, 10 September 2010

Looking for someone who wants to help getting this sorted out.

Siebrand09:25, 11 September 2010

I send out two notices that I hope will get some attention.

Siebrand09:50, 11 September 2010

If someone wonders about the Gettext, there isn't any agreed standard on those rules, and different projects may use different rules for the same language. The list of Gettext rules would be those used by and is built on multiple sources. The raw data for Gettext is at [1] and preprocessed CLDR data is at [2]. There is one more peculiarity with CLDR data, that it also tries to take into account decimal numbers.

Nike10:19, 11 September 2010

I am glad to say that CLDR have now changed their plural rules for Welsh to agree with the rules on See the ticket and the rules.

I haven't attempted to do anything with Gettext yet, and won't be in a position to tackle this for a while. Having had some discussions with the Bedwyr Language Institute at Bangor University about the plural rules (they requested the changes at CLDR), it appears that most commercial websites and computer programs have in the past just not put any plural rules for Welsh onto their systems. Since the mutation rules are complex, it appears that some linguists have opted to not mutate at all, just using the singular form of a word in an unmutated state, analogous to websites in English which use 'him' to refer to 'him/her'. Given that that is the case, it might prove impossible to get Gettext to follow the CLDR and pattern. How big a problem is it likely to be in future if Gettext continues to be out of step with CLDR for Welsh?

Lloffiwr18:05, 4 December 2010

As far as I know we can put any rule we want into Gettext headers.

Nike19:12, 4 December 2010

OK. If that is so, am I right in thinking that for the projects here which use Gettext, we can use the 6 plural rules for Welsh, same as currently used on MediaWiki and CLDR?

Lloffiwr19:18, 4 December 2010

Yes, that's how I think it works. The current set of Gettext rules in the comparison is just collection of rules from different sources.

Nike19:29, 4 December 2010

Documenting plural on language portals

I have noticed that only a few language portals have notes or links to sub-pages of notes on plural for their language. I think we need to recommend that each language which doesn't use the default plural rules make notes on plural on their portal, so that any new translators have easy access to this information. Ideally, it would be good to have the page on Plural/Mediawiki plural rules checked before requesting documentation on the language portals, to avoid confusion if there are mistakes on the page (which is more than likely since I am not familiar with software code). I am willing to do the work of putting a request for documentation, to be written in the language of the portal, on the talk pages of those languages which differ from English plural in either Mediawiki or CLDR. Any comments before I start?

Lloffiwr (talk)14:05, 9 April 2012

Requests to check Mediawiki plural rules and for documentation left on language portal talk pages.

Lloffiwr (talk)17:53, 28 April 2012

SVN or Git?

This page writes about Mediawiki with SVN in mind. As far as I know, Mediawiki just shifted to Git. And this page should reflect that.

The transitions is underway, but doesn't actually affect this topic in any way.

Nike (talk)12:58, 5 March 2012

A lot of links are going to SVN from the plural page and from plural/Mediawiki plural rules. When the migration is done, if the links need to be redone, can someone provide the new address of this to set me on the right path?

Lloffiwr (talk)17:56, 31 March 2012

Difference between CLDR plural rules and MediaWiki plural rules

CLDR plural rules define different sets of decimal numbers according to the differences in grammar which occur in a sentence which includes those numbers - see Language Plural Rules on CLDR. These rules do not appear to cover the situation where a decimal number does not appear in a sentence.

In MediaWiki there are a handful of sentences where the PLURAL magic word is used but no number appears in the sentence. In these sentences there is a subject or object which can be either singular or plural and PLURAL is used to enable correct grammatical sentences where verbs, pronouns, etc differ according to the (unstated) number of items discussed. Some examples are:

  • Hidden-categories ("Hidden categories")
  • Cascadeprotected ("This page has been protected from editing because it is transcluded in the following pages, which are protected with the "cascading" option turned on:


Potentially there are grammar changes triggered here which are different from the grammar rules triggered by changes in decimal numbers. For example:

  • the form of a collective noun (referring to 'more than one') may be different to the form used with a specific number, for example in "the 11 following things" and "the following things" the form for "things" may differ.
  • verb or pronoun forms used may be different for singular and collective plurals, but not different when the number is included in the sentence.

I know these cases should be rare, and it may be that in practice there are no languages where the CLDR rules do not cover all the uses of PLURAL in MediaWiki as well, but potentially there could be languages affected by this difference in how PLURAL is used on MediaWiki and how it is defined on CLDR. Does anyone know of any languages affected by this?

I think that this is not really an issue that necessarily needs to be raised at CLDR, although I am sure they would be interested to learn about how MediaWiki uses PLURAL in sentences that do not include a decimal number. However, what it may mean is that there may be rare cases where will need to define more number sets for a language than there are in CLDR.

Lloffiwr16:24, 1 August 2010
Edited by another user.
Last edit: 18:43, 29 January 2012

In other words we want to know if there is a language where any given number-included plural form is not a subset of number-less plural form. If this is the case, then we cannot achieve number-less forms by just combining existing (number-included) plural forms (in practice, giving them the same translation) in suitable combination.

Nike17:25, 1 August 2010

And in far fewer words than I used:)

Lloffiwr17:46, 1 August 2010

I'm not aware of a language not having the wanted subset relation. Since there may be ones, I think, CLDR should be made aware, with the suggestion to make a note on their explanatory page. Unless someone reports that (s)he did it already, I shall do that.

Purodha Blissenbach08:40, 18 September 2010

Well, I think, it would be a superset, but anyways. When going through the above examples again, I found that in Colognian, a sentence followed or preceded by a list (the items of which you can count) is to be treated and built exactly as if the number was included, even if the sentence itself is numberless.

Purodha Blissenbach18:18, 14 May 2011

The page on plural rule syntax at CLDR says: "There are two extra values that can be used with count attributes: 0 and 1. These are used for the explicit values, and may or may not be the same as the forms for "zero" and "one"." It seems that CLDR have got around the problem of defining additional categories for use in particular circumstances by introducing these 2 additional values. Would it be possible to write code for Mediawiki plural which does the same, enabling the use of '0' and '1' only when needed?

Lloffiwr (talk)11:05, 10 March 2012

How would you specify those parameters?

Nike (talk)09:26, 6 April 2012

I wrote the previous comment before I had understood how Mediawiki uses more than one defined plural ruleset to handle numberless sentences (and potentially sentences with zero?). Mediawiki's solution appears to be elegant, with simpler syntax for translators for numberless sentences.

However, you also say in another thread that it is 'hard to unify Mediawiki rules with other systems'. Would it be easier to unify with other systems if instead of making the second ruleset shorter than the normal ruleset, instead we made it longer, typically by adding an additional rule for 1 (or for 1 and 2 for Scottish Gaelic for example) and an additional rule for 0 where needed (Swahili would benefit from an additional rule for 0, for example). Making the second ruleset longer is not as elegant as the current system. But does it help with compatibility with other systems?

Lloffiwr (talk)10:52, 7 April 2012

The table of Plural/Mediawiki_plural_rules has been drafted. Could a staff member or someone who understands software code please check that I have interpreted the software rules correctly?

Lloffiwr (talk)13:06, 9 April 2012

Russian plural

I notice that Russian appears to have two different sets of rules defined - see the SVN file. One set is used in sentences with numbers, one in sentences without numbers. Can someone confirm that the software recognises which set of plural to use by whether the sentence contains the number or not? If this works for Russian, then presumably it could work for all languages, and would be of interest to some of the languages where the number 1 is in a group with other numbers. Please can a developer comment before I try to write this up on the plural page.

Lloffiwr (talk)17:36, 31 March 2012

Languages lt, sh, sr and uk also appear to have 2 sets of rules, as for Russian.

Lloffiwr (talk)18:34, 31 March 2012

Software doesn't recognize it. It just acts differently when less than usual number of forms are given (which is something that makes it hard to unify mediawiki rules with other systems).

Nike (talk)20:49, 31 March 2012

I have tried to write this up on Plural#Alternative_ruleset. As usual, I would be grateful if this could be checked for accuracy and usefulness. I have also added an extra column to the table of Mediawiki plural rules to carry a note on which languages have the additional ruleset.

Lloffiwr (talk)14:56, 1 April 2012

Only for your information


for your information I would like to point out to you that there is still another plural system that is used by Mozilla programs (Firefox, SeaMonkey, Thunderbird ...), see here. It's for your information only because I think that is not relevant for current Translatewiki projects.

Kind regards

Michawiki (talk)00:15, 13 March 2012
First page
First page
Next page
Next page
Last page
Last page