Commit 5255df89 authored by Mame Coumba Sall's avatar Mame Coumba Sall

2009-03-17 mame

script modified to use generic method to get message id with context

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26082 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f0a30e07
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Document import newTempBase\n <value> <string>from Products.ERP5Type.Document import newTempBase\n
from Products.ERP5Type.Utils import getTranslationStringWithContext\n from Products.ERP5Type.Utils import getMessageIdWithContext\n
\n \n
supported_languages = context.Localizer.get_supported_languages()\n supported_languages = context.Localizer.get_supported_languages()\n
translated_keys = {} # This dict prevents entering the same key twice\n translated_keys = {} # This dict prevents entering the same key twice\n
...@@ -83,7 +83,7 @@ for wf in context.portal_workflow.objectValues():\n ...@@ -83,7 +83,7 @@ for wf in context.portal_workflow.objectValues():\n
# translate state title as well\n # translate state title as well\n
if state.title != \'\' :\n if state.title != \'\' :\n
state_var_title = \'%s_title\' % state_var\n state_var_title = \'%s_title\' % state_var\n
msg_id = msg_id = \'%s [state in %s]\' % (state.title, wf.id)\n msg_id = getMessageIdWithContext(state.title,\'state\',wf.id)\n
translated_message = context.Localizer.erp5_ui.gettext(msg_id, default=\'\').encode(\'utf-8\')\n translated_message = context.Localizer.erp5_ui.gettext(msg_id, default=\'\').encode(\'utf-8\')\n
if translated_message == \'\':\n if translated_message == \'\':\n
translated_message = context.Localizer.erp5_ui.gettext(state.title.decode(\'utf-8\'), lang=lang).encode(\'utf-8\')\n translated_message = context.Localizer.erp5_ui.gettext(state.title.decode(\'utf-8\'), lang=lang).encode(\'utf-8\')\n
...@@ -164,7 +164,7 @@ return printed\n ...@@ -164,7 +164,7 @@ return printed\n
<string>Products.ERP5Type.Document</string> <string>Products.ERP5Type.Document</string>
<string>newTempBase</string> <string>newTempBase</string>
<string>Products.ERP5Type.Utils</string> <string>Products.ERP5Type.Utils</string>
<string>getTranslationStringWithContext</string> <string>getMessageIdWithContext</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>supported_languages</string> <string>supported_languages</string>
......
1120 1122
\ No newline at end of file \ 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