try... execpt plural_rules
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.0.3 (2012-08-31 00:29:05) stable
|
Version 2.0.3 (2012-08-31 00:31:48) stable
|
||||||
|
|||||||
+19
-12
@@ -220,18 +220,25 @@ def read_possible_plurals():
|
|||||||
create list of all possible plural rules files
|
create list of all possible plural rules files
|
||||||
result is cached to increase speed
|
result is cached to increase speed
|
||||||
"""
|
"""
|
||||||
import gluon.contrib.plural_rules as package
|
try:
|
||||||
plurals = {}
|
import gluon.contrib.plural_rules as package
|
||||||
for importer, modname, ispkg in pkgutil.iter_modules(package.__path__):
|
plurals = {}
|
||||||
if len(modname)==2:
|
for importer, modname, ispkg in pkgutil.iter_modules(package.__path__):
|
||||||
module = __import__(package.__name__+'.'+modname)
|
if len(modname)==2:
|
||||||
lang = modname
|
module = __import__(package.__name__+'.'+modname)
|
||||||
pname = modname+'.py'
|
lang = modname
|
||||||
nplurals = getattr(module,'nplurals', DEFAULT_NPLURALS)
|
pname = modname+'.py'
|
||||||
get_plural_id = getattr(module,'get_plural_id', DEFAULT_GET_PLURAL_ID)
|
nplurals = getattr(module,'nplurals', DEFAULT_NPLURALS)
|
||||||
construct_plural_form = getattr(module,'construct_plural_form',
|
get_plural_id = getattr(
|
||||||
DEFAULT_CONSTRUCTOR_PLURAL_FORM)
|
module,'get_plural_id',
|
||||||
plurals[lang] = (lang, nplurals, get_plural_id, construct_plural_form, pname)
|
DEFAULT_GET_PLURAL_ID)
|
||||||
|
construct_plural_form = getattr(
|
||||||
|
module,'construct_plural_form',
|
||||||
|
DEFAULT_CONSTRUCTOR_PLURAL_FORM)
|
||||||
|
plurals[lang] = (lang, nplurals, get_plural_id,
|
||||||
|
construct_plural_form, pname)
|
||||||
|
except ImportError:
|
||||||
|
logging.warn('Unable to import plural rules')
|
||||||
plurals['default'] = ('default',
|
plurals['default'] = ('default',
|
||||||
DEFAULT_NPLURALS,
|
DEFAULT_NPLURALS,
|
||||||
DEFAULT_GET_PLURAL_ID,
|
DEFAULT_GET_PLURAL_ID,
|
||||||
|
|||||||
Reference in New Issue
Block a user