New plural rules for Scots Gaelic (gd)

From Support
Jump to navigation Jump to search

New plural rules for Scots Gaelic (gd)

I could do with some help to add rules for Scots Gaelic plurals. We've recently had to do that for Firefox too but I'm not good with programming but here is the ruleset we formulated over at Mozilla:

The formula for Gaelic (gd) plurals is: Form 1 is for 1, 11, 21, 31; Form 2 is for 2, 12, 22, 32; Form 3 is for 3-10, 13-19, 23-29, 33-39; Form 4 is everything else: 20, 30, 40+

"Plural-Forms: nplurals=4; plural=(n%10==1 && n < 40) ? 0 : (n%10==2 && n < 40) ? 1 : (n==10 || (n%10 > 2 && n < 40)) ? 2 : 3\n"

Thanks very much :)

Akerbeltz21:26, 30 June 2010

MediaWiki (well, Siebrand, actually :-) imports the CLDR definitions, so your goal is to define the rules there. Have a look at the CLDR documentation Language Plural Rules and see what you can make of it. The 'mod' used at CLDR is equivalent to the use of '%' in the Firefox definition, i.e. the modulus of a number. You'll also need to qualify the different modes with a name, rather than a number.

Hamilton Abreu22:01, 30 June 2010

These are the current comments in LanguageGd.php:

	 * Plural form transformations
	 * Based on this discussion:
	 * $forms[0] - singular form (for 1)
	 * $forms[1] - dual form (for 2)
	 * $forms[2] - plural form 1 (for 3-10)
	 * $forms[3] - plural form 2 (for >= 11)

Please read it over. Maybe it enlightens you, maybe you can add something. Either way. I have checked CLDR, and CLDR does not have plurals for Gaelic at the moment. I would advise you to open a ticket there, and, with reference to an authorative source, get the proper plural forms listed there.

This is the current PLURAL source code for MediaWiki in Gaelic:

		if ($count > 10 && floor(($count % 100) / 10) == 1) {
			return $forms[2];
		} else {
			switch ($count % 10) {
				case 1:  return $forms[0];
				case 2:
				case 3:
				case 4:  return $forms[1];
				default: return $forms[2];

If, after careful consideration, and I require support from another person, or a reference to a credible authoritative source, we do need to change the plural forms, it will be done. Preferably both the comment as lasted above, and the source code are to be listed in this topic.

Siebrand22:17, 30 June 2010

Ok, thanks for the quick replies. I didn't realise there was a ruleset already.

I'll open a ticket with CLDR though I've been warned of their response speed ;)

Beyond that, the current LanguageGd.php is unnecessarily inadequate by claiming that "above 10 it gets messy" or "isn't that important". It's true in most languages that there's a certain amount of variation the spoken language gets away with but that does not mean you cannot codify one standard model. I can produce sources galore, what do you have in mind?

Akerbeltz01:25, 1 July 2010

The current plural rules were implemented by me after discussion with User:Sionnach months ago. I sent Sionnach an e-mail now to get her attention into this discussion.

Raymond06:42, 1 July 2010

Ok, I've opened the ticket at CLDR

Akerbeltz19:04, 1 July 2010

Ok, the decimal system suggested by Akerbeltz is more accurate but still simple and I agree with it.

* 1, 11 >> Form 1
* 2, 12 >> Form 2
* 3-10, 13-19 >> Form 3
* 20 and anything above >> Form 4
Sionnach20:35, 1 July 2010

Can I ask whether the whole sentence should be negated in Scots Gaelic, if the number is 0? Does Scots Gaelic use singular or plural forms with 0? Even if the grammar for 0 is different to English, this will not necessarily trigger an extra form in MediaWiki. There are two languages, Swahili and Manx, where sentences negate for 0, but where discussion (on Support, can't remember when) led to the conclusion that the number of times the grammar will be wrong in MediaWiki is negligible. This is because usually, two separate English messages are created where 0 is a possibility, because they prefer to use 'no' instead of '0'. There is a message on the recent changes page where 0 does occasionally occur as part of the PLURAL function. There may be others. In Welsh, however, we chose to include 0 as a form, which of course is more work, but also more flexible.

However, on CLDR, you might prefer to mention this (if 0 does trigger grammar changes in Scots Gaelic), and you may prefer to include 0 as a possibility here on in case it is needed in current or future projects other than MediaWiki. The advice on CLDR (I don't have the link handy just now) is to document any grammar changes caused by plural numbers, not just changes to the noun forms.

Lloffiwr12:39, 2 July 2010

Also, are you sure that you want 1 and 11 together as one form? Are there any grammar differences between 1 and 11 other than noun plurals? For example, is the translation of 'There is/are 1/11 sub-category/ies to this category' the same in Scots Gaelic?

Lloffiwr13:09, 2 July 2010

0 does not trigger any changes not covered by the four forms (it would be 0 + Form 4). But I take it you mean if a sentence like "there are 0 users logged in" would be "there are 0 users logged in" or "there are no users logged in"? The second would be more natural but it would not be a major problem if we had "there are 0 users logged in" in Gaelic.

Yes, 1 and 11 go together because in Gaelic 1 cause a morphophonemic change; as 11 is treated as 1 NOUN 10, the same rule applies, for example: 1 chat - in words aon (1) chat 11 chat - in words aon (1) chat deug (10)

Beyond that, no, there are no other chages (such as the is/are difference in English). In Gaelic the verb only reflects the status of declarative/interrogative/negative but does not change with number (fortunately... there is enough bizarre stuff going on!).

Akerbeltz21:27, 2 July 2010

What I meant with negating a sentence for 0, is that in both Welsh and Manx we would say 'there ARE NOT 0 users logged in' instead of 'there ARE 0 users logged in' - the negative form of the verb is used. And in Welsh it sticks out like a sore thumb to have the sentence use a positive verb form. Would be interested to know whether Scots Gaelic uses negative or positive verbs for discussing nothing; in other words, do you use the convention that nothing EXISTS (as in English) or nothing DOESN'T EXIST (as in Welsh/Manx)?:-)

Lloffiwr21:41, 2 July 2010

Ah right I see what you mean. No, it would be a declarative (positive) sentence, very similar to English, for example tha 0 cleachdaichean air logadh a-steach "be 0 users after logging in".

Akerbeltz21:43, 2 July 2010

My replies are not showing up on support also! A bug somewhere?

Back to the point. That's interesting. Thank you for the explanations. I think that you need to explicitly add 0 to the group using form 4 - the folks at CLDR will probably ask about this.

Lloffiwr21:47, 2 July 2010

Ok, I will, thanks for the pointer!

You reckon we can implement the changes here though before CLDR does anything since Sionnach is in agreement? I can provide sources galore but CLDR can be, as far as I'm told, a bit slow.

Akerbeltz21:56, 2 July 2010

Also, are you sure that you want 1 and 11 together as one form? Are there any grammar differences between 1 and 11 other than noun plurals? For example, is the translation of 'There is/are 1/11 sub-category/ies to this category' the same in Scots Gaelic?

Lloffiwr21:26, 2 July 2010

Grr just lost my reply.

Yes, 1 and 11 go together as 1 causes a morphophonemic change; as 11 is treated as 1 NOUN 10, is undergoes the same change - same applies to 2, 12 (2 NOUN 10).

For example, cat changes thus: 1 chat - in words aon (1) chat 11 chat - in words aon (1) chat deug (10)

It would be more natural to treat 0 as (for example" "there are no users logged in" rather than "there are 0 users logged in" but using 0 isn't a massive problem and the forms are covered by Form 4.

There are no verb changes take place as Gaelic verby only reflect the status of declarative/interrogative/negative but not 1,2,3 etc person. Fortunately. There are enough bizarre things going on as is!

Akerbeltz21:33, 2 July 2010

Sorry to be a pain - back to the issue of 1 and 11 being in the same group. There are some sentences here which refer to a thing by name without a number; something like 'the sub-category was moved' or 'the sub-categories were moved', where the PLURAL function is used to write either 'sub-category' for 1 or 'sub-categories' for all other numbers. Would the word for 'sub-category' and 'sub-categories' be the same in Scots Gaelic?

Lloffiwr21:59, 2 July 2010

You're not being a pain - I appreciate your patience with a rather awkward number system!

Gaelic distinguishes singular and plural (the dual is pretty much obsolete). If used without a numeral, then there are no morphophonemic changes that neet to be observed beyong the singular/plural morphology.

Using sub-categories, you'd get
tha fo-roinn ann "be subcategory in.existance"
tha fo-roinntean ann "be subcategories in.existance".

If you cound subcategories, you get the whole shebang (and before you ask, I've added the word duilleag "page" as well because words with initial dentals are different (hence Form 1/2):
1 fho-roinn | duilleag
2 fho-roinn | dhuilleag
3 fo-roinntean | duilleagan
11 fho-roinn | duilleag
12 fho-roinn | dhuilleag
13 fo-roinntean | duilleagan
20 fo-roinn

Akerbeltz22:10, 2 July 2010

OK, liquid threads appears to have recovered from its hissy fit! I have found a few examples of MediaWiki using the PLURAL function in sentences which depend on a number variable but which don't actually use the number in the sentence:

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


If you want to keep 1 and 11 in the same group, then you would perhaps have to live with using the plural noun form for that group, so that the grammar is correct for 11. Cascadeprotected and Caascadeprotectedwarning also contain relative pronouns, which in Welsh are spelled differently when referring to singular and plural nouns.

By the way, you might be interested that the complex number system in Welsh is similar to the Scots Gaelic system described above. However, we can also use an alternative decimal system for cardinal numbers (but not ordinals), invented in the nineteenth century, which puts the tens before the units - a lot simpler but still unable to completely unseat the complex number system.

We also have initial mutations, like Scots Gaelic, and that, together with negating sentences with 0, accounts for the 6 forms used for PLURAL in Welsh. There are some words which cause mutations with various other numbers, but you have to call a halt somewhere!

Our dual numbers also disappeared a long time ago, and survive only in a few idiosyncracies such as 'dwylo' for a pair of hands.


Lloffiwr10:30, 3 July 2010

Ah yes, not too dissimilar - except we have the bizarre situation of having gone from decimal in Old Irish to vigesimal in modern Irish and Gaelic to decimal and vigesimal because educators bizarrely thought you can't to maths in 20s... go figure. Sometimes I'm glad though we only have one type of mutation that's written ;)

The relative pronouns won't be a problem, it's not bothered about singular/plural.

PLURAL:$1|Hidden category|Hidden categories

the following cascade-protected PLURAL:$1|page|pages

Ok if I get you right, the above would result in one instance of singular category, page and then when the numeral goes above 1, it applies plural forms but that clashes with our formula because Gaelic thinks 11 is a singular form whereas English says it's a plural?

Hm. Annoying. Could we stick 11 (and 12 also then I guess) into its own form? Would something like this solve the headache:

  • 1 >> Form 1
  • 2 >> Form 2
  • 3-10 >> Form 3
  • 11 >> Form 1
  • 12 >> Form 2
  • 13-19 >> Form 3
  • 0, 20 and anything above >> Form 4
Akerbeltz10:49, 3 July 2010

Thanks for the interesting extra info on Scots Gaelic.

Yes, separating 1 and 11 into two groups would solve your problem in the messages above. (How bothered Scots Gaelic users are with this is not for me to say, of course). Amending your original groupings gives the following:

  • 1 >> Form 1
  • 2, 12 >> Form 2
  • 11 >> Form 3
  • 3-10, 13-19 >> Form 4
  • 0, 20 and anything above >> Form 4
Lloffiwr11:06, 3 July 2010

We have to do the same for 12 too though, because it's also treated as singular (but with lenition of all words), cf:
1 dùn, 11 dùn, 2 dhùn, 12 dhùn
3 dùin

Bothered... in this case very. I'm all for not being overly conservative in grammar and style but this is a very important thing to get right.

Akerbeltz11:24, 3 July 2010

OK. I must say that I enjoy working on partly because, being volunteers, we are able to concentrate on quality rather than quantity or speed of translation.

So, again amending your original formulation, you need 6 categories altogether

  • 1 >> Form 1
  • 2 >> Form 2
  • 11 >> Form 3
  • 12 >> Form 4
  • 3-10, 13-19 >> Form 5
  • 0, 20 and anything above >> Form 6
Lloffiwr12:22, 3 July 2010

It does make a nice change, especially the feeling that the people at the other end are actually interested in the peculiarities of your language and getting it right. Try explaining the plurals issue to the Google in Your Language team >.<

Yes, that would appear to cover it all, dioch yn fawr, a charaid!

Akerbeltz12:47, 3 July 2010

So have these been implemented now? How do I find out?

Akerbeltz13:07, 18 December 2010

Ok finally found where they're kept [1] - so they new ruleset hasn't been implemented yet.

I've been trying to push Unicode for months now, there's no chance that anything will happen there in a hurry so could we please amend the rules we have agreed on being better for Gaelic? I've got a whole host of messages I can't translate because otherwise.

Akerbeltz13:15, 18 December 2010

Like this?

Nike14:35, 18 December 2010

Oh happy days :) Thanks everybody who helped!

Akerbeltz19:03, 30 January 2011

Old thread, but just asking a clarification. The CLDR ticket has 4 forms(One, Two, Few, Other). And Mediawiiki has 6 forms. Do you have plans to make the CLDR plural forms same as medawiki plural forms?

Santhosh.thottingal (talk)09:03, 27 January 2012

Anyone can contribute to CLDR in theory, same as for Please see our page on CLDR for a quick overview. Please note that there is a difference in treatment of plural rules on CLDR and Up until now CLDR has in practice given the impression that their PLURAL rules only cover situations where numbers appear in a sentence. Mediawiki uses plural in sentences without numbers as well as with numbers. Please see Talk:CLDR#Difference_between_CLDR_plural_rules_and_MediaWiki_plural_rules_6182this discussion and feel free to contribute, both to that discussion and to the related ticket on CLDR. I had better add that CLDR is a very good place to practice the virtues of patience and perseverance.

Lloffiwr (talk)22:51, 28 January 2012

The plural rules are the same both on CLDR and here. However, there are technical reasons why Wikipedia requires more "forms". If you read carefully, both the CLDR rules and Wikipedia rules amount to the following ruleset: 1, 11 > Form 1 2, 12 > Form 2 3-10, 13-19 > Form 3 0, Any other > Form 4

But for some technical reason, you can't bunch together numbers like that in Wikipedia so we got 1 > Form 1a 11 > Form 1b 2 > Form 2a 12 > Form 2b or to that effect.

Akerbeltz (talk)01:34, 9 February 2012

There are no technical reasons preventing from doing that. See the previous comment by Lloffiwr.

Nike (talk)09:34, 9 February 2012

If you expand all the comments above, you'll see that it was Lloffiwr who okayed the current solution. The reason is (according to Lloffiwr) that Wiki logic looks for a plural for anything above 1 but that in Gaelic, 11 patterns with 1 (i.e. 1 of something and 11 of something is treated the same, as if it was singular). The only workable solution that was mooted at the time was to split these apart, counting 11 as a fake plural.

I'm a great believer in "if it ain't broke, don't fix it" ... why the sudden rush to change something that's working fine?

Akerbeltz (talk)00:41, 15 February 2012

Akerbeltz- the comment from Santosh.thottingal of 27.1.12 does not propose any changes to It does discuss whether we, the community, wish to request changes to CLDR. My comment as a fellow translator at, with no more authority to "OKay" anything than any other translator, and as someone with a very small amount of experience contributing to CLDR, is that any application to change the PLURAL rules for Scots Gaelic at CLDR had better be addressed to them directly.

As to the question of whether the PLURAL rules work for CLDR, you will see by following the links provided above in my comment of 28 January 2012, that the issue at stake is; how are the software writers using the CLDR rules using PLURAL in their programmes. If they use PLURAL only in sentences which also contain a digit, then (if I understood your explanations of Scots Gaelic grammar above correctly), the software translators will be able to produce grammatically correct sentences for all numbers using the 4 rules only. However, if software writers also use PLURAL in sentences where no number appears, then the two additional cases are needed. CLDR have clarified that they do want PLURAL rules to cover situations where no numbers appear in a sentence (see the link to CLDR above) and therefore Scots Gaelic speakers may conclude that they wish to apply to CLDR to expand the PLURAL rule set to 6. As you are no doubt aware, the downside of having more rules is that the translators have more work to do in forming translations using PLURAL.

Lloffiwr (talk)17:24, 15 February 2012

The rules at CLDR are fine. I handled the plural submission and the xml locale data submission for Scots Gaelic there. I raised the issue we had here and I was told that this is not necessary regarding the data held at CLDR on Gaelic plurals.

Akerbeltz (talk)01:41, 16 February 2012

PS the rules at CLDR are also the same we use on Mozilla, LibreOffice and several other projects and they all produce the right forms. You may remember that I was rather surprised that they wouldn't work here the way they're intended to work so if anything needs tweaking, it's withing Wiki, not CLDR or the other projects.

Akerbeltz (talk)01:49, 16 February 2012