Commit f0746cd0 authored by Michal Čihař's avatar Michal Čihař

Another type of plural

parent cdec159a
......@@ -258,6 +258,10 @@ ONE_TWO_FEW_OTHER_PLURALS = (
'n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3',
)
ONE_TWO_FEW_MANY_OTHER_PLURALS = (
'n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n<11 ? 3 : 4',
)
ONE_FEW_MANY_OTHER_PLURALS = (
'n==1 ? 0 : n==0 || ( n%100>1 && n%100<11) ? 1 : '
'(n%100>10 && n%100<20 ) ? 2 : 3'
......
......@@ -40,6 +40,7 @@ PLURAL_ONE_TWO_FEW_OTHER = 6
PLURAL_ONE_OTHER_ZERO = 7
PLURAL_ONE_FEW_MANY_OTHER = 8
PLURAL_TWO_OTHER = 9
PLURAL_ONE_TWO_FEW_MANY_OTHER = 10
PLURAL_UNKNOWN = 666
# Plural equation - type mappings
......@@ -52,6 +53,7 @@ PLURAL_MAPPINGS = (
(data.ONE_OTHER_ZERO_PLURALS, PLURAL_ONE_OTHER_ZERO),
(data.ONE_FEW_MANY_OTHER_PLURALS, PLURAL_ONE_FEW_MANY_OTHER),
(data.TWO_OTHER_PLURALS, PLURAL_TWO_OTHER),
(data.ONE_TWO_FEW_MANY_OTHER_PLURALS, PLURAL_ONE_TWO_FEW_MANY_OTHER),
)
......@@ -295,6 +297,13 @@ PLURAL_NAMES = {
pgettext_lazy('Plural form description', 'Many'),
pgettext_lazy('Plural form description', 'Other'),
),
PLURAL_ONE_TWO_FEW_MANY_OTHER: (
pgettext_lazy('Plural form description', 'One'),
pgettext_lazy('Plural form description', 'Two'),
pgettext_lazy('Plural form description', 'Few'),
pgettext_lazy('Plural form description', 'Many'),
pgettext_lazy('Plural form description', 'Other'),
),
PLURAL_TWO_OTHER: (
pgettext_lazy('Plural form description', 'Two'),
pgettext_lazy('Plural form description', 'Other'),
......@@ -314,6 +323,7 @@ class Language(models.Model):
(PLURAL_ONE_OTHER_ZERO, 'One/other/zero'),
(PLURAL_ONE_FEW_MANY_OTHER, 'One/few/many/other'),
(PLURAL_TWO_OTHER, 'Two/other'),
(PLURAL_ONE_TWO_FEW_MANY_OTHER, 'One/two/few/many/other'),
(PLURAL_UNKNOWN, 'Unknown'),
)
code = models.SlugField(unique=True)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment