diff --git a/VERSION b/VERSION index 3fddb10c..3f596498 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-07-18 12:45:12) dev +Version 2.00.0 (2012-07-18 12:48:05) dev diff --git a/applications/admin/languages/plural-en.py b/applications/admin/languages/plural-en.py new file mode 100644 index 00000000..638e23e3 --- /dev/null +++ b/applications/admin/languages/plural-en.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python +{ +# "singular form (0)": ["first plural form (1)", "second plural form (2)", ...], +'file': ['files'], +} diff --git a/applications/admin/languages/plural-ru.py b/applications/admin/languages/plural-ru.py new file mode 100644 index 00000000..4ccd46ad --- /dev/null +++ b/applications/admin/languages/plural-ru.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python +{ +# "singular form (0)": ["first plural form (1)", "second plural form (2)", ...], +'файл': ['файла','файлов'], +} diff --git a/applications/admin/languages/plural-uk.py b/applications/admin/languages/plural-uk.py new file mode 100644 index 00000000..a6a34aef --- /dev/null +++ b/applications/admin/languages/plural-uk.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python +{ +# "singular form (0)": ["first plural form (1)", "second plural form (2)", ...], +'файл': ['файли','файлів'], +} diff --git a/applications/welcome/routes.example.py b/applications/welcome/routes.example.py new file mode 100644 index 00000000..363080a8 --- /dev/null +++ b/applications/welcome/routes.example.py @@ -0,0 +1,40 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# This is an app-specific example router +# +# This simple router is used for setting languages from app/languages directory +# as a part of the application path: app//controller/function +# Language from default.py or 'en' (if the file is not found) is used as +# a default_language +# +# See /router.example.py for parameter's detail +#------------------------------------------------------------------------------------- +# To enable this route file you must do the steps: +# +# 1. rename /router.example.py to routes.py +# 2. rename this APP/routes.example.py to APP/routes.py +# (where APP - is your application directory) +# 3. restart web2py (or reload routes in web2py admin interfase) +# +# YOU CAN COPY THIS FILE TO ANY APLLICATION'S ROOT DIRECTORY WITHOUT CHANGES! + +from fileutils import abspath +from languages import read_possible_languages + +possible_languages = read_possible_languages(abspath('applications', app)) +#NOTE! app - is an application based router's parameter with name of an +# application. E.g.'welcome' + +routers = { + app: dict( + default_language = possible_languages['default'][0], + languages = [lang for lang in possible_languages + if lang != 'default'] + ) +} + +#NOTE! To change language in your application using these rules add this line +#in one of your models files: +# if request.uri_language: T.force(request.uri_language) + diff --git a/gluon/contrib/rules/plural_rules-af.py b/gluon/contrib/rules/plural_rules-af.py new file mode 100644 index 00000000..9c0c8c61 --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-bg.py b/gluon/contrib/rules/plural_rules-bg.py new file mode 100644 index 00000000..985c5797 --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-cs.py b/gluon/contrib/rules/plural_rules-cs.py new file mode 100644 index 00000000..47e5e1d5 --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-de.py b/gluon/contrib/rules/plural_rules-de.py new file mode 100644 index 00000000..5393cd92 --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-en.py b/gluon/contrib/rules/plural_rules-en.py new file mode 100644 index 00000000..73a52400 --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-es.py b/gluon/contrib/rules/plural_rules-es.py new file mode 100644 index 00000000..7f6a510a --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-fr.py b/gluon/contrib/rules/plural_rules-fr.py new file mode 100644 index 00000000..4237c0e3 --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-he.py b/gluon/contrib/rules/plural_rules-he.py new file mode 100644 index 00000000..c1e316da --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-hi.py b/gluon/contrib/rules/plural_rules-hi.py new file mode 100644 index 00000000..d636c1e0 --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-hu.py b/gluon/contrib/rules/plural_rules-hu.py new file mode 100644 index 00000000..ea960e29 --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-it.py b/gluon/contrib/rules/plural_rules-it.py new file mode 100644 index 00000000..ba3c7b5d --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-ja.py b/gluon/contrib/rules/plural_rules-ja.py new file mode 100644 index 00000000..168bccb8 --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-lt.py b/gluon/contrib/rules/plural_rules-lt.py new file mode 100644 index 00000000..c7f4451f --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-pl.py b/gluon/contrib/rules/plural_rules-pl.py new file mode 100644 index 00000000..a61a6a53 --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-pt.py b/gluon/contrib/rules/plural_rules-pt.py new file mode 100644 index 00000000..57718af3 --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-ro.py b/gluon/contrib/rules/plural_rules-ro.py new file mode 100644 index 00000000..9158a3d4 --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-ru.py b/gluon/contrib/rules/plural_rules-ru.py new file mode 100644 index 00000000..23c4f563 --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-sk.py b/gluon/contrib/rules/plural_rules-sk.py new file mode 100644 index 00000000..df8d5232 --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-sl.py b/gluon/contrib/rules/plural_rules-sl.py new file mode 100644 index 00000000..465072d2 --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-tr.py b/gluon/contrib/rules/plural_rules-tr.py new file mode 100644 index 00000000..8d61e14e --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-uk.py b/gluon/contrib/rules/plural_rules-uk.py new file mode 100644 index 00000000..bbd4b4e4 --- /dev/null +++ b/gluon/contrib/rules/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/rules/plural_rules-zh.py b/gluon/contrib/rules/plural_rules-zh.py new file mode 100644 index 00000000..0eed6c7c --- /dev/null +++ b/gluon/contrib/rules/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 +