diff --git a/CHANGELOG b/CHANGELOG index 92517a1b..1c025961 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,6 +11,7 @@ - allow URL(...,language=...) with parametric router, thanks Jonathan - allow non-expiration of gae-memcache, thanks crimsoncantab - MARKMIN(...,_class='...'), thanks Luca +- better transliteration in building slugs - autolink emails - new Janrain API, thanks PeterQ2 - enable admin app for GAE (experimental), thanks Alan diff --git a/VERSION b/VERSION index 700ab809..908f447b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.9.1-stable+timestamp.2014.03.02.17.18.31 +Version 2.9.1-stable+timestamp.2014.03.02.17.44.56 diff --git a/gluon/languages.py b/gluon/languages.py index ecf0c9d6..aaf0882f 100644 --- a/gluon/languages.py +++ b/gluon/languages.py @@ -658,7 +658,12 @@ class translator(object): set_plural(language) self.accepted_language = language return languages - self.accepted_language = language or self.current_languages[0] + self.accepted_language = language + if not language: + if self.current_languages: + self.accepted_language = self.current_languages[0] + else: + self.accepted_language = DEFAULT_LANGUAGE self.language_file = self.default_language_file self.cache = global_language_cache.setdefault(self.language_file, ({}, RLock())) diff --git a/gluon/validators.py b/gluon/validators.py index 71c3267a..18c0a897 100644 --- a/gluon/validators.py +++ b/gluon/validators.py @@ -20,7 +20,8 @@ import decimal from cStringIO import StringIO from gluon.utils import simple_hash, web2py_uuid, DIGEST_ALG_BY_SIZE from gluon.dal import FieldVirtual, FieldMethod - +from gluon.contrib import translitcodec + regex_isint = re.compile('^[+-]?\d+$') JSONErrors = (NameError, TypeError, ValueError, AttributeError,