My, that was nasty.
This commit is contained in:
parent
91b9c9bcfb
commit
a07630c17a
1 changed files with 2 additions and 7 deletions
|
@ -29,15 +29,10 @@ turbogears.view.variable_providers.append(add_custom_stdvars)
|
||||||
def get_locale(locale=None):
|
def get_locale(locale=None):
|
||||||
if locale:
|
if locale:
|
||||||
return locale
|
return locale
|
||||||
username = None
|
|
||||||
try:
|
try:
|
||||||
username = turbogears.identity.current.user_name
|
user = turbogears.identity.current.user
|
||||||
|
return turbogears.identity.user.locale or 'C'
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
|
||||||
if username:
|
|
||||||
person = People.by_username(turbogears.identity.current.user_name)
|
|
||||||
return person.locale or 'C'
|
|
||||||
else:
|
|
||||||
return turbogears.i18n.utils._get_locale()
|
return turbogears.i18n.utils._get_locale()
|
||||||
|
|
||||||
config.update({'i18n.get_locale': get_locale})
|
config.update({'i18n.get_locale': get_locale})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue