Skip to content

Commit

Permalink
more choices for getting a language out of the qweb context
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Vinet committed May 1, 2015
1 parent 3a28f87 commit a12a7fb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions qweb_usertime/qweb.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ def render_tag_usertime(self, element, template_attributes,
generated_attributes, qwebcontext):
tformat = template_attributes['usertime']
if not tformat:
# No format, use default time and date formats from user lang
lang = qwebcontext['user'].lang
# No format, use default time and date formats from qwebcontext
lang = (
qwebcontext['env'].lang or
qwebcontext['env'].context['lang'] or
qwebcontext['user'].lang
)
if lang:
lang = qwebcontext['env']['res.lang'].search(
[('code', '=', lang)]
Expand Down

0 comments on commit a12a7fb

Please sign in to comment.