Updated docstring
authorThierry Florac <thierry.florac@onf.fr>
Tue, 27 Jun 2017 13:26:10 +0200
changeset 31 65e4710b699f
parent 30 e82b56583f65
child 32 e90691696919
Updated docstring
src/pyams_i18n/expr.py
--- a/src/pyams_i18n/expr.py	Wed Jun 21 16:23:21 2017 +0200
+++ b/src/pyams_i18n/expr.py	Tue Jun 27 13:26:10 2017 +0200
@@ -25,7 +25,12 @@
 
 
 def render_i18n_expression(econtext, name):
-    """Render an I18n expression"""
+    """Render an I18n expression
+
+    Value can be given as a single attribute name (for example: "i18n:title"), in which case value
+    is extracted from current "context".
+    But value can also be given as a dotted name, for example "i18n:local_var.property.title".
+    """
 
     name = name.strip()
     if '.' in name:
@@ -35,8 +40,7 @@
             context = getattr(context, name)
         attr = names[-1]
     else:
-        context_name = 'context',
-        context = econtext.get(context_name)
+        context = econtext.get('context')
         attr = name
     request = econtext.get('request')
     return II18n(context).query_attribute(attr, request=request)