summaryrefslogtreecommitdiff
path: root/babel/messages/plurals.py
Commit message (Collapse)AuthorAgeFilesLines
* Apply ruff I category fixesAarni Koskela2023-01-181-1/+1
|
* Add type annotations (#934)Jonah Lawrence2023-01-111-5/+6
| | | | | | | Refs e.g. https://github.com/python/typeshed/pull/9455 Co-authored-by: Spencer Brown <spencerb21@live.com> Co-authored-by: Aarni Koskela <akx@iki.fi>
* Fix up some Python2-isms using pyupgradeAarni Koskela2022-05-101-1/+0
|
* fix maltese pluralsLukas Winkler2022-01-281-1/+1
|
* Update copyright year to 2022Aarni Koskela2022-01-251-1/+1
|
* Become 2.9.1Aarni Koskela2021-04-281-1/+1
| | | | | * Update copyright year * Update changelog
* Bump copyright year from 2019 to 2020Aarni Koskela2020-11-111-1/+1
|
* Bump copyright year from 2018 to 2019Aarni Koskela2019-05-271-1/+1
|
* Update copyright header years, and include the Babel teamAarni Koskela2018-02-021-1/+1
|
* Updated plurals.py to match Mozilla and CLDR referencesMax Shenfield2016-07-111-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit updates the plural rules, and in some cases the plural number, for languages based on review of https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals, and http://www.unicode.org/cldr/charts/29/supplemental/language_plural_rules.html. I changed the interface (either the number of plurals, or the meaning of each index), for the following languages: • Arabic (ar): numplurals same, semantics differ per Mozilla's "Plural rule #12". 3 has been made more accurate, 4 has been switched with 5, and the meaning of both has been refined to match the rule. • Belarusian (ar): numplurals updated to 3, using Mozilla's "Plural rule #7". Previously the default, where anything except one is plural. • Breton (br): numplurals updated to 6, using Mozilla's "Plural rule • Bosnian (bs): numplurals updated to 3, using Mozilla's "Plural rule • Irish Gaelic (ga): numplurals update from 3 to 5, using Mozilla's "Plural rule #11". Cases have been added for n between 3 and 6, and n between 7 and 10. • Icelandic (is): same numplurals (2), semantics updated using Mozilla's "Plural rule #15". 0 now means that n ends in 1, and is not 11, instead of just the number 1. • Maltese (mt): same numplurals, same rule. Fixed rule, index 1 now includes numbers ending in 1 (except the number 1) I'm ignoring these two rules listed on the Mozilla resource • Hungarian - listed as `(n != 1)`. It is not required to pluralize a noun if a qualitative or quantitative amount precedes it http://www.hungarianreference.com/plurals.aspx. • Vietnamese - listed as `(n != 1)`. It only seems to have one plural according to this lesson: http://yourvietnamese.com/vietnamese-grammar/nouns-in-vietnamese/. There are some additional languages listed in the Mozilla reference that are not in the plurals document, and could be added: • Lower Sorbian (dsb) (4, '(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3)') • Upper Sorbian (hsb) (4, '(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3)') • Scottish Gaelic (gd) (4, '(n==1 || n==11 ? 0 : n==2 || n==12 ? 1 : (n>=3 && n<=10) || (n>=13 && n<=19) ? 2 : 3)') • Faroese (fo) (2, '(n != 1)') • Frisian (fy) (2, '(n != 1)') • Macedonian (mk) (3, '(n%10==1 ? 0 : n%10==2 ? 1 : 2)') Closes https://github.com/python-babel/babel/issues/430
* plurals: correct plural forms for cs and sk localesYuriy Shatrov2016-04-051-2/+2
| | | | | | Change plural forms for Czech (cs) and Slovak (sk) locales from Plural rule #_7_ to Plural rule #_8_ according to https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals . Fixes https://github.com/python-babel/babel/issues/372
* Fix typo and add semicolon in plural_formsLukas B2015-12-301-3/+3
| | | | | Fix typo and add semicolon in plural_forms (missing l in 'plural' and semicolon at the end). It currently produces incorrect plural form string.
* plurals: Fix selection for chineseMichael Birtwell2015-10-211-4/+2
| | | | | | | | | Provide only one option in chinese. The 3 previous options where all the same any how and I've checked with a chinese colleague she thinks that applies to all variants on the chinese language. Refactor the get_plural tests a bit so they are split up to test specific things
* Some codestyle updates in babel.messages.pluralsArmin Ronacher2013-07-251-0/+3
|
* License clarification and cleanupArmin Ronacher2013-07-241-13/+9
|
* Update the copyright line.Jeroen Ruigrok van der Werven2011-03-051-1/+1
|
* Get rid of the utility code for itemgetter(), we now simply import thisJeroen Ruigrok van der Werven2011-03-051-1/+1
| | | | | from operator.
* Fix Serbian plural forms (ticket #213).Jeroen Ruigrok van der Werven2010-04-111-1/+1
| | | | | Submitted by: Patrice Neff
* fix Python 2.3 compat: rearrange set/itemgetter/rsplit/sorted/unicode.decodePhilip Jenvey2008-10-081-2/+1
| | | | | usage. still has a few, unimportant failing tests
* Added babel.messages.plurals.get_plural which returns a special tuple with ↵Armin Ronacher2008-07-011-0/+63
| | | | the plural information.
* More preparation for msgctxt support (#54).Christopher Lenz2008-06-111-5/+5
|
* Add a Plural-Forms for Cymraeg (Welsh).Jeroen Ruigrok van der Werven2008-01-201-1/+1
| | | | | See #71
* Assume that, since Chuvash is a Turkic language, Chuvash follows the sameJeroen Ruigrok van der Werven2007-12-311-1/+1
| | | | | | | | plurality rules as Turkish. For the interested: Chuvash is spoken by approximately 2 million people in Russia and uses an augmented Cyrillic alphabet to write their Oghuric-Turkic language.
* Given Dzongkha's relation to Tibetan for now assume the same plurality rulesJeroen Ruigrok van der Werven2007-12-311-1/+1
| | | | | | are in effect. For the interested: Dzongkha is the official language of Bhutan.
* Add commented ISO 639-1 codes up to 'e'.Jeroen Ruigrok van der Werven2007-12-311-0/+52
|
* Add a definition for Lao.Jeroen Ruigrok van der Werven2007-12-301-0/+2
|
* Use consistent English names for all language names.Jeroen Ruigrok van der Werven2007-12-131-5/+5
|
* Add plural forms definition for Tibetan.Jeroen Ruigrok van der Werven2007-12-121-0/+2
| | | | | | Discussed in private with Andrew West, well-known and respect Sino-Tibetan scholar and Unicode contributor.
* Add a plurals definition for Thai.Jeroen Ruigrok van der Werven2007-12-061-0/+2
|
* Add actual data structures for handling message catalogs, so that more code ↵Christopher Lenz2007-06-081-0/+2
| | | | can be reused here between the frontends.
* Rename the `babel.catalog` package to `babel.messages` for consistency with ↵Christopher Lenz2007-06-081-0/+133
the other package names.