Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_workflow
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenjie.zheng
erp5_workflow
Commits
bc3677f1
Commit
bc3677f1
authored
Oct 15, 2015
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core: fix ERP5Site_updateTranslationTable didn't update translation table problem.
parent
1a149fbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
19 deletions
+21
-19
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_updateTranslationTable.xml
...ortal_skins/erp5_core/ERP5Site_updateTranslationTable.xml
+21
-19
No files found.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_updateTranslationTable.xml
View file @
bc3677f1
...
...
@@ -72,25 +72,27 @@ def catalog_translation_list(object_list):\n
object_list = []\n
portal_workflow = context.portal_workflow\n
portal_type_list = context.portal_types.objectValues()\n
chain_dict = portal_workflow.getChainDict()\n
for wf in portal_workflow.objectValues():\n
if wf is None:\n
continue\n
wf_id = wf.getId()\n
state_var = wf.getStateVariable()\n
if wf.getStateValueList():\n
state_value_list = wf.getStateValueList().items()\n
for state_id, state in state_value_list:\n
for lang in supported_languages:\n
for portal_type in portal_type_list:\n
if wf_id not in portal_type.getTypeWorkflowList() and portal_type.getId() not in getattr(chain_dict, wf_id,[]):\n
# do not check unrelated portal type.\n
continue\n
key = (lang, portal_type, state_var, state_id)\n
chain_dict = portal_workflow.getChainsByType()\n
for portal_type in portal_type_list:\n
pt_id = portal_type.getId()\n
associated_workflow_id_list = []\n
associated_workflow_id_list.extend(portal_type.getTypeWorkflowList())\n
if pt_id in chain_dict:\n
associated_workflow_id_list.extend(list(chain_dict[pt_id]))\n
for wf_id in associated_workflow_id_list:\n
wf = getattr(context.portal_workflow, wf_id, None)\n
if wf is None:\n
continue\n
state_var = wf.getStateVariable()\n
if wf.getStateValueList():\n
state_value_list = wf.getStateValueList()\n
for state_ref, state in state_value_list.items():\n
for lang in supported_languages:\n
key = (lang, pt_id, state_var, state_ref)\n
if not translated_keys.has_key(key):\n
translated_message = context.Localizer.erp5_ui.gettext(state_
id
, lang=lang).encode(\'utf-8\')\n
translated_message = context.Localizer.erp5_ui.gettext(state_
ref
, lang=lang).encode(\'utf-8\')\n
translated_keys[key] = None # mark as translated\n
object_list.append(dict(language=lang, message_context=state_var, portal_type=p
ortal_type, original_message=state_id
,\n
object_list.append(dict(language=lang, message_context=state_var, portal_type=p
t_id, original_message=state_ref
,\n
translated_message=translated_message))\n
\n
# translate state title as well\n
...
...
@@ -101,10 +103,10 @@ for wf in portal_workflow.objectValues():\n
if translated_message == \'\':\n
msg_id = state.title\n
translated_message = context.Localizer.erp5_ui.gettext(state.title.decode(\'utf-8\'), lang=lang).encode(\'utf-8\')\n
key = (lang, p
ortal_type, state_var_title, state_id
, msg_id)\n
key = (lang, p
t_id, state_var_title, state_ref
, msg_id)\n
if not translated_keys.has_key(key):\n
translated_keys[key] = None # mark as translated\n
object_list.append(dict(language=lang, message_context=state_var_title, portal_type=p
ortal_type, original_message=state_id
,\n
object_list.append(dict(language=lang, message_context=state_var_title, portal_type=p
t_id, original_message=state_ref
,\n
translated_message=translated_message))\n
if object_list:\n
catalog_translation_list(object_list)\n
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment