jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/307478 )
Change subject: update plural rules ......................................................................
update plural rules
from http://localization-guide.readthedocs.io/en/latest/l10n/pluralforms.html
Also keep lines beneath 80 chars.
Bug: T114978 Change-Id: I50be17b22bb4a661dc527a56d82734318fcf99dd --- M pywikibot/plural.py 1 file changed, 23 insertions(+), 21 deletions(-)
Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/plural.py b/pywikibot/plural.py index ddb6ce1..ddca184 100644 --- a/pywikibot/plural.py +++ b/pywikibot/plural.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- """Module containing plural rules of various languages.""" # -# (C) xqt, 2011 -# (C) Pywikibot team, 2011 +# (C) xqt, 2011-2017 +# (C) Pywikibot team, 2011-2017 # # Distributed under the terms of the MIT license. # @@ -27,13 +27,13 @@ 'ay': {'nplurals': 1, 'plural': 0}, 'be': {'nplurals': 3, 'plural': lambda n: 0 if (n % 10 == 1 and n % 100 != 11) else - 1 if (n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20)) else + 1 if (n % 10 in range(2, 5) and (n % 100 < 10 or n % 100 >= 20)) else 2}, 'bo': {'nplurals': 1, 'plural': 0}, 'br': {'nplurals': 2, 'plural': lambda n: (n > 1)}, 'bs': {'nplurals': 3, 'plural': lambda n: 0 if (n % 10 == 1 and n % 100 != 11) else - 1 if (n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20)) else + 1 if (n % 10 in range(2, 5) and (n % 100 < 10 or n % 100 >= 20)) else 2}, 'cgg': {'nplurals': 1, 'plural': 0}, 'cs': {'nplurals': 3, 'plural': lambda n: @@ -42,15 +42,13 @@ 2}, 'csb': {'nplurals': 3, 'plural': lambda n: 0 if (n == 1) else - 1 if (n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20)) else + 1 if n % 10 in range(2, 5) and (n % 100 < 10 or n % 100 >= 20) else 2}, - 'cy': {'nplurals': 6, 'plural': lambda n: - 0 if (n == 0) else - 1 if (n == 1) else - 2 if (n == 2) else - 3 if (n == 3) else - 4 if (n == 6) else - 5}, + 'cy': {'nplurals': 4, 'plural': lambda n: + 0 if (n == 1) else + 1 if (n == 2) else + 2 if (n != 8 and n != 11) else + 3}, 'dz': {'nplurals': 1, 'plural': 0}, 'fa': {'nplurals': 1, 'plural': 0}, 'fil': {'nplurals': 2, 'plural': lambda n: (n > 1)}, @@ -69,9 +67,10 @@ 'gun': {'nplurals': 2, 'plural': lambda n: (n > 1)}, 'hr': {'nplurals': 3, 'plural': lambda n: 0 if (n % 10 == 1 and n % 100 != 11) else - 1 if (n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20)) else + 1 if (n % 10 in range(2, 5) and (n % 100 < 10 or n % 100 >= 20)) else 2}, 'id': {'nplurals': 1, 'plural': 0}, + 'is': {'nplurals': 2, 'plural': lambda n: (n % 10 != 1 or n % 100 == 11)}, 'ja': {'nplurals': 1, 'plural': 0}, 'jbo': {'nplurals': 1, 'plural': 0}, 'ka': {'nplurals': 1, 'plural': 0}, @@ -97,7 +96,9 @@ 'mfe': {'nplurals': 2, 'plural': lambda n: (n > 1)}, 'mg': {'nplurals': 2, 'plural': lambda n: (n > 1)}, 'mi': {'nplurals': 2, 'plural': lambda n: (n > 1)}, - 'mk': {'nplurals': 2, 'plural': lambda n: 0 if n == 1 or n % 10 == 1 else 1}, + 'mk': {'nplurals': 2, 'plural': lambda n: + 0 if n == 1 or n % 10 == 1 else + 1}, 'mnk': {'nplurals': 3, 'plural': lambda n: 0 if (n == 0) else 1 if n == 1 else @@ -108,11 +109,11 @@ 1 if (n == 0 or (n % 100 > 1 and n % 100 < 11)) else 2 if (n % 100 > 10 and n % 100 < 20) else 3}, - 'nso': {'nplurals': 2, 'plural': lambda n: (n > 1)}, + 'my': {'nplurals': 1, 'plural': 0}, 'oc': {'nplurals': 2, 'plural': lambda n: (n > 1)}, 'pl': {'nplurals': 3, 'plural': lambda n: 0 if (n == 1) else - 1 if (n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20)) else + 1 if (n % 10 in range(2, 5) and (n % 100 < 10 or n % 100 >= 20)) else 2}, 'pt-br': {'nplurals': 2, 'plural': lambda n: (n > 1)}, 'ro': {'nplurals': 3, 'plural': lambda n: @@ -121,8 +122,9 @@ 2}, 'ru': {'nplurals': 3, 'plural': lambda n: 0 if (n % 10 == 1 and n % 100 != 11) else - 1 if (n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20)) else + 1 if (n % 10 in range(2, 5) and (n % 100 < 10 or n % 100 >= 20)) else 2}, + 'sah': {'nplurals': 1, 'plural': 0}, 'sk': {'nplurals': 3, 'plural': lambda n: 0 if (n == 1) else 1 if (n >= 2 and n <= 4) else @@ -134,19 +136,19 @@ 3}, 'sr': {'nplurals': 3, 'plural': lambda n: 0 if (n % 10 == 1 and n % 100 != 11) else - 1 if (n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20)) else + 1 if (n % 10 in range(2, 5) and (n % 100 < 10 or n % 100 >= 20)) else 2}, 'su': {'nplurals': 1, 'plural': 0}, 'th': {'nplurals': 1, 'plural': 0}, 'ti': {'nplurals': 2, 'plural': lambda n: (n > 1)}, - 'tr': {'nplurals': 1, 'plural': 0}, + 'tr': {'nplurals': 2, 'plural': lambda n: (n > 1)}, 'tt': {'nplurals': 1, 'plural': 0}, 'ug': {'nplurals': 1, 'plural': 0}, 'uk': {'nplurals': 3, 'plural': lambda n: 0 if (n % 10 == 1 and n % 100 != 11) else - 1 if (n % 10 >= 2 and n % 10 <= 4 and (n % 100 < 10 or n % 100 >= 20)) else + 1 if (n % 10 in range(2, 5) and (n % 100 < 10 or n % 100 >= 20)) else 2}, - 'uz': {'nplurals': 1, 'plural': 0}, + 'uz': {'nplurals': 2, 'plural': lambda n: (n > 1)}, 'vi': {'nplurals': 1, 'plural': 0}, 'wa': {'nplurals': 2, 'plural': lambda n: (n > 1)}, 'wo': {'nplurals': 1, 'plural': 0},
pywikibot-commits@lists.wikimedia.org