diff --git a/VERSION b/VERSION index 9ac0127c..b232783f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.0.3 (2012-08-31 00:11:28) stable +Version 2.0.3 (2012-08-31 00:29:05) stable diff --git a/gluon/contrib/plural_rules/__init__.py b/gluon/contrib/plural_rules/__init__.py new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/gluon/contrib/plural_rules/__init__.py @@ -0,0 +1 @@ + diff --git a/gluon/contrib/plural_rules/af.py b/gluon/contrib/plural_rules/af.py new file mode 100644 index 00000000..9c0c8c61 --- /dev/null +++ b/gluon/contrib/plural_rules/af.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for af (Afrikaans (South Africa)) + +nplurals=2 # Afrikaans language has 2 forms: + # 1 singular and 1 plural + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = lambda n: int(n != 1) + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +# construct_plural_form = lambda word, plural_id: (word + 'suffix') + diff --git a/gluon/contrib/plural_rules/bg.py b/gluon/contrib/plural_rules/bg.py new file mode 100644 index 00000000..985c5797 --- /dev/null +++ b/gluon/contrib/plural_rules/bg.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for bg (Bulgarian) + +nplurals=2 # Bulgarian language has 2 forms: + # 1 singular and 1 plural + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = lambda n: int(n != 1) + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +# construct_plural_form = lambda word, plural_id: (word + 'suffix') + diff --git a/gluon/contrib/plural_rules/cs.py b/gluon/contrib/plural_rules/cs.py new file mode 100644 index 00000000..47e5e1d5 --- /dev/null +++ b/gluon/contrib/plural_rules/cs.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for cs (Czech) + +nplurals=3 # Czech language has 3 forms: + # 1 singular and 2 plurals + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = lambda n: ( 0 if n==1 else + 1 if 2<=n<=4 else + 2 ) + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +# construct_plural_form = lambda word, plural_id: (word + 'suffix') + diff --git a/gluon/contrib/plural_rules/de.py b/gluon/contrib/plural_rules/de.py new file mode 100644 index 00000000..5393cd92 --- /dev/null +++ b/gluon/contrib/plural_rules/de.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for de (Deutsch) + +nplurals=2 # German language has 2 forms: + # 1 singular and 1 plural + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = lambda n: int(n != 1) + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +# construct_plural_form = lambda word, plural_id: (word + 'suffix') + diff --git a/gluon/contrib/plural_rules/en.py b/gluon/contrib/plural_rules/en.py new file mode 100644 index 00000000..73a52400 --- /dev/null +++ b/gluon/contrib/plural_rules/en.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for en (English) + +nplurals=2 # English language has 2 forms: + # 1 singular and 1 plural + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = lambda n: int(n != 1) + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +construct_plural_form = lambda word, plural_id: (word + + ('es' if word[-1:] in ('s','x','o') or + word[-2:] in ('sh','ch') + else 's')) + diff --git a/gluon/contrib/plural_rules/es.py b/gluon/contrib/plural_rules/es.py new file mode 100644 index 00000000..7f6a510a --- /dev/null +++ b/gluon/contrib/plural_rules/es.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for es (Spanish) + +nplurals=2 # Spanish language has 2 forms: + # 1 singular and 1 plural + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = lambda n: int(n != 1) + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +# construct_plural_form = lambda word, plural_id: (word + 'suffix') + diff --git a/gluon/contrib/plural_rules/fr.py b/gluon/contrib/plural_rules/fr.py new file mode 100644 index 00000000..4237c0e3 --- /dev/null +++ b/gluon/contrib/plural_rules/fr.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for fr (French)) + +nplurals=2 # French language has 2 forms: + # 1 singular and 1 plural + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = lambda n: int(n != 1) + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +# construct_plural_form = lambda word, plural_id: (word + 'suffix') + diff --git a/gluon/contrib/plural_rules/he.py b/gluon/contrib/plural_rules/he.py new file mode 100644 index 00000000..c1e316da --- /dev/null +++ b/gluon/contrib/plural_rules/he.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for he (Hebrew) + +nplurals=2 # Hebrew language has 2 forms: + # 1 singular and 1 plural + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = lambda n: int(n != 1) + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +# construct_plural_form = lambda word, plural_id: (word + 'suffix') + diff --git a/gluon/contrib/plural_rules/hi.py b/gluon/contrib/plural_rules/hi.py new file mode 100644 index 00000000..d636c1e0 --- /dev/null +++ b/gluon/contrib/plural_rules/hi.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for he (Hindi) + +nplurals=2 # Hindi has 2 forms: + # 1 singular and 1 plural + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = lambda n: int(n != 1) + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +# construct_plural_form = lambda word, plural_id: (word + 'suffix') + diff --git a/gluon/contrib/plural_rules/hu.py b/gluon/contrib/plural_rules/hu.py new file mode 100644 index 00000000..ea960e29 --- /dev/null +++ b/gluon/contrib/plural_rules/hu.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for hu (Hungarian) + +nplurals=2 # Hungarian language has 2 forms: + # 1 singular and 1 plural + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = lambda n: int(n != 1) + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +# construct_plural_form = lambda word, plural_id: (word + 'suffix') + diff --git a/gluon/contrib/plural_rules/it.py b/gluon/contrib/plural_rules/it.py new file mode 100644 index 00000000..ba3c7b5d --- /dev/null +++ b/gluon/contrib/plural_rules/it.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for it (Italian) + +nplurals=2 # Italian language has 2 forms: + # 1 singular and 1 plural + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = lambda n: int(n != 1) + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +# construct_plural_form = lambda word, plural_id: (word + 'suffix') + diff --git a/gluon/contrib/plural_rules/ja.py b/gluon/contrib/plural_rules/ja.py new file mode 100644 index 00000000..168bccb8 --- /dev/null +++ b/gluon/contrib/plural_rules/ja.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for ja (Japanese) + +nplurals=1 # Japanese language has ONE form! + +# Always returns 0: +get_plural_id = lambda n: 0 + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +# construct_plural_form = lambda word, plural_id: word + diff --git a/gluon/contrib/plural_rules/lt.py b/gluon/contrib/plural_rules/lt.py new file mode 100644 index 00000000..c7f4451f --- /dev/null +++ b/gluon/contrib/plural_rules/lt.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for lt (Lithuanian) + +nplurals=3 # Lithuanian language has 3 forms: + # 1 singular and 2 plurals + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = lambda n: (0 if n % 10 == 1 and n % 100 != 11 else + 1 if n % 10 >= 2 and (n % 100 < 10 or n % 100 >= 20) else + 2) + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +# construct_plural_form = lambda word, plural_id: (word + 'suffix') + diff --git a/gluon/contrib/plural_rules/pl.py b/gluon/contrib/plural_rules/pl.py new file mode 100644 index 00000000..a61a6a53 --- /dev/null +++ b/gluon/contrib/plural_rules/pl.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for pl (Polish) + +nplurals=3 # Polish language has 3 forms: + # 1 singular and 2 plurals + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = lambda n: (0 if n==1 else + 1 if 2<=n<=4 else + 2) + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +# construct_plural_form = lambda word, plural_id: (word + 'suffix') + diff --git a/gluon/contrib/plural_rules/pt.py b/gluon/contrib/plural_rules/pt.py new file mode 100644 index 00000000..57718af3 --- /dev/null +++ b/gluon/contrib/plural_rules/pt.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for pt (Portuguese) + +nplurals=2 # Portuguese has 2 forms: + # 1 singular and 1 plural + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = lambda n: int(n != 1) + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +# construct_plural_form = lambda word, plural_id: (word + 'suffix') + diff --git a/gluon/contrib/plural_rules/ro.py b/gluon/contrib/plural_rules/ro.py new file mode 100644 index 00000000..9158a3d4 --- /dev/null +++ b/gluon/contrib/plural_rules/ro.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for ro (Romanian) + +nplurals=2 # Romanian has 2 forms: + # 1 singular and 1 plural + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = lambda n: int(n != 1) + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +# construct_plural_form = lambda word, plural_id: (word + 'suffix') + diff --git a/gluon/contrib/plural_rules/ru.py b/gluon/contrib/plural_rules/ru.py new file mode 100644 index 00000000..23c4f563 --- /dev/null +++ b/gluon/contrib/plural_rules/ru.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for ru (Russian) + +nplurals=3 # Russian language has 3 forms: + # 1 singular and 2 plurals + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = 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 + 2) + +# construct_plural_form() is not used now because of complex +# rules of Russian language. Default version of +# this function is used to simple insert new words into +# plural_dict dictionary) +# construct_plural_form = lambda word, plural_id: word diff --git a/gluon/contrib/plural_rules/sk.py b/gluon/contrib/plural_rules/sk.py new file mode 100644 index 00000000..df8d5232 --- /dev/null +++ b/gluon/contrib/plural_rules/sk.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for sk (Slovak (Slovakia)) + +nplurals=3 # Slovak language has 3 forms: + # 1 singular and 2 plurals + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = 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 + 2) + +# construct_plural_form() is not used now because of complex +# rules of Slovak language. Default version of this function +# is used to simple insert new words into plural_dict dictionary) +# construct_plural_form = lambda word, plural_id: word + diff --git a/gluon/contrib/plural_rules/sl.py b/gluon/contrib/plural_rules/sl.py new file mode 100644 index 00000000..465072d2 --- /dev/null +++ b/gluon/contrib/plural_rules/sl.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for sl (Slovenian) + +nplurals=4 # Slovenian language has 4 forms: + # 1 singular and 3 plurals + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = lambda n: (0 if n % 100 == 1 else + 1 if n % 100 == 2 else + 2 if n % 100 in (3,4) else + 3) + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +# construct_plural_form = lambda word, plural_id: (word + 'suffix') + diff --git a/gluon/contrib/plural_rules/tr.py b/gluon/contrib/plural_rules/tr.py new file mode 100644 index 00000000..8d61e14e --- /dev/null +++ b/gluon/contrib/plural_rules/tr.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for tr (Turkish) + +nplurals=1 # Turkish language has ONE form! + +# Always returns 0: +get_plural_id = lambda n: 0 + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +# construct_plural_form = lambda word, plural_id: word + diff --git a/gluon/contrib/plural_rules/uk.py b/gluon/contrib/plural_rules/uk.py new file mode 100644 index 00000000..bbd4b4e4 --- /dev/null +++ b/gluon/contrib/plural_rules/uk.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for uk (Ukrainian) + +nplurals=3 # Ukrainian language has 3 forms: + # 1 singular and 2 plurals + +# Determine plural_id for number *n* as sequence of positive +# integers: 0,1,... +# NOTE! For singular form ALWAYS return plural_id = 0 +get_plural_id = 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 + 2) + +# construct_plural_form() is not used now because of complex +# rules of Ukrainian language. Default version of +# this function is used to simple insert new words into +# plural_dict dictionary) +# construct_plural_form = lambda word, plural_id: word + diff --git a/gluon/contrib/plural_rules/zh.py b/gluon/contrib/plural_rules/zh.py new file mode 100644 index 00000000..0eed6c7c --- /dev/null +++ b/gluon/contrib/plural_rules/zh.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +# -*- coding: utf8 -*- +# Plural-Forms for zh (Chinese) + +nplurals=1 # Chinese language has ONE form! + +# Always returns 0: +get_plural_id = lambda n: 0 + +# Construct and return plural form of *word* using +# *plural_id* (which ALWAYS>0). This function will be executed +# for words (or phrases) not found in plural_dict dictionary +# construct_plural_form = lambda word, plural_id: word +