Commit 291f6e78 authored by Yusei Tahara's avatar Yusei Tahara

2008-08-28 yusei

* Extract translation message from tal:dfeine expression.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23219 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d26864a4
......@@ -61,9 +61,19 @@ def findStaticTranslationText(page_template, func_name_list):
text_dict.update(interpreter._i18n_message_id_dict)
def addTextFromPythonExpression(node):
if node[0]=='insertText':
tal_expression = node[1]
if isinstance(tal_expression, (tuple, list)):
tal_expression = tal_expression[0]
elif node[0] in ('setLocal', 'setGlobal'):
if len(node)==2:
tal_expression = node[1][1]
elif len(node)==3:
tal_expression = node[2]
else:
return
else:
return
tal_expression = tal_expression[1:-1]
match = name_match(tal_expression)
if match:
......@@ -86,6 +96,8 @@ def findStaticTranslationText(page_template, func_name_list):
parser.parseString(page_template._text)
iterate(parser.gen.program, 'insertTranslation', addText)
iterate(parser.gen.program, 'insertText', addTextFromPythonExpression)
iterate(parser.gen.program, 'setLocal', addTextFromPythonExpression)
iterate(parser.gen.program, 'setGlobal', addTextFromPythonExpression)
return text_dict.keys()
#
......
2008-08-28 yusei
* Extract translation message from tal:dfeine expression.
2008-08-27 yusei
* Improve pot file export.
......
323
\ No newline at end of file
324
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment