[Erp5-report] r26074 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Mar 17 15:07:29 CET 2009
Author: mame
Date: Tue Mar 17 15:07:23 2009
New Revision: 26074
URL: http://svn.erp5.org?rev=26074&view=rev
Log:
2009-03-17 mame
*modified script to use generic method to translate workflow state titles.
Modified:
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_updateTranslationTable.xml
erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml?rev=26074&r1=26073&r2=26074&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml [utf8] Tue Mar 17 15:07:23 2009
@@ -56,6 +56,8 @@
<value> <string>request = context.REQUEST\n
from Products.ERP5Type.Document import newTempBase\n
from Products.ERP5Type.Document import newTempMappedValue\n
+from Products.ERP5Type.Utils import getTranslationStringWithContext\n
+\n
\n
marker = []\n
result = []\n
@@ -78,8 +80,7 @@
actor_name_cache[actor] = person.getTitle()\n
return actor_name_cache[actor]\n
\n
-def getMessageIdForWorkflowState(title, workflow_id):\n
- return \'%s [state in %s]\' % (title, workflow_id)\n
+\n
\n
# Get history\n
# XXX Compatibility\n
@@ -128,8 +129,7 @@
elif key == \'actor\':\n
value = getActorName(value)\n
elif same_type(value, \'\') and key in (\'state\' ):\n
- value = getMessageIdForWorkflowState(value, workflow_id) \n
- value = context.Localizer.erp5_ui.gettext(value)\n
+ value = getTranslationStringWithContext(context,value, key, workflow_id)\n
elif same_type(value, \'\') and key in ( \'action\'):\n
value = context.Localizer.erp5_ui.gettext(value)\n
if value is marker:\n
@@ -207,6 +207,8 @@
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>newTempMappedValue</string>
+ <string>Products.ERP5Type.Utils</string>
+ <string>getTranslationStringWithContext</string>
<string>marker</string>
<string>result</string>
<string>i</string>
@@ -221,7 +223,6 @@
<string>dict</string>
<string>actor_name_cache</string>
<string>getActorName</string>
- <string>getMessageIdForWorkflowState</string>
<string>history_name</string>
<string>workflow_item_list</string>
<string>_getitem_</string>
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_updateTranslationTable.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_updateTranslationTable.xml?rev=26074&r1=26073&r2=26074&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_updateTranslationTable.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_updateTranslationTable.xml [utf8] Tue Mar 17 15:07:23 2009
@@ -54,6 +54,7 @@
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Document import newTempBase\n
+from Products.ERP5Type.Utils import getTranslationStringWithContext\n
\n
supported_languages = context.Localizer.get_supported_languages()\n
translated_keys = {} # This dict prevents entering the same key twice\n
@@ -82,11 +83,10 @@
# translate state title as well\n
if state.title != \'\' :\n
state_var_title = \'%s_title\' % state_var\n
- msg_id = \'%s [state in %s]\' % (state.title, wf.id)\n
+ msg_id = msg_id = \'%s [state in %s]\' % (state.title, wf.id)\n
translated_message = context.Localizer.erp5_ui.gettext(msg_id, default=\'\').encode(\'utf-8\')\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
key = (lang, state_var_title, state_id, state.title)\n
if not translated_keys.has_key(key):\n
translated_keys[key] = None # mark as translated\n
@@ -163,6 +163,8 @@
<string>_print</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
+ <string>Products.ERP5Type.Utils</string>
+ <string>getTranslationStringWithContext</string>
<string>_getattr_</string>
<string>context</string>
<string>supported_languages</string>
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=26074&r1=26073&r2=26074&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] Tue Mar 17 15:07:23 2009
@@ -1,1 +1,1 @@
-1111
+1120
More information about the Erp5-report
mailing list