Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
erp5
Commits
16041773
Commit
16041773
authored
Jun 29, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: fix bad name + useless if
parent
14517d93
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
25 deletions
+22
-25
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_updateTranslationTable.py
...portal_skins/erp5_core/ERP5Site_updateTranslationTable.py
+22
-25
No files found.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_updateTranslationTable.py
View file @
16041773
...
@@ -22,41 +22,38 @@ portal_workflow = context.portal_workflow
...
@@ -22,41 +22,38 @@ portal_workflow = context.portal_workflow
portal_type_list
=
context
.
portal_types
.
objectValues
()
portal_type_list
=
context
.
portal_types
.
objectValues
()
chain_dict
=
portal_workflow
.
getChainsByType
()
chain_dict
=
portal_workflow
.
getChainsByType
()
for
portal_type
in
portal_type_list
:
for
portal_type
in
portal_type_list
:
pt_id
=
portal_type
.
id
associated_workflow_id_list
=
[]
associated_workflow_id_list
=
[]
associated_workflow_id_list
.
extend
(
portal_type
.
getTypeWorkflowList
())
associated_workflow_id_list
.
extend
(
portal_type
.
getTypeWorkflowList
())
if
p
t_
id
in
chain_dict
:
if
p
ortal_type
.
id
in
chain_dict
:
associated_workflow_id_list
.
extend
(
list
(
chain_dict
[
p
t_
id
]))
associated_workflow_id_list
.
extend
(
list
(
chain_dict
[
p
ortal_type
.
id
]))
for
wf_id
in
associated_workflow_id_list
:
for
wf_id
in
associated_workflow_id_list
:
wf
=
getattr
(
context
.
portal_workflow
,
wf_id
,
None
)
wf
=
getattr
(
context
.
portal_workflow
,
wf_id
,
None
)
if
wf
is
None
:
if
wf
is
None
:
continue
continue
state_var
=
wf
.
getStateVariable
()
state_var
=
wf
.
getStateVariable
()
if
wf
.
getStateValueDict
():
state_value_list
=
wf
.
getStateValueDict
()
for
state_id
,
state
in
wf
.
getStateValueDict
().
items
():
for
state_ref
,
state
in
state_value_list
.
items
():
for
lang
in
supported_languages
:
for
lang
in
supported_languages
:
key
=
(
lang
,
portal_type
.
id
,
state_var
,
state_id
)
key
=
(
lang
,
pt_id
,
state_var
,
state_ref
)
if
not
translated_keys
.
has_key
(
key
):
translated_message
=
context
.
Localizer
.
erp5_ui
.
gettext
(
state_id
,
lang
=
lang
).
encode
(
'utf-8'
)
translated_keys
[
key
]
=
None
# mark as translated
object_list
.
append
(
dict
(
language
=
lang
,
message_context
=
state_var
,
portal_type
=
portal_type
.
id
,
original_message
=
state_id
,
translated_message
=
translated_message
))
# translate state title as well
if
state
.
title
is
not
None
and
state
.
title
!=
''
:
state_var_title
=
'%s_title'
%
state_var
msg_id
=
getMessageIdWithContext
(
state
.
title
,
'state'
,
wf_id
)
translated_message
=
context
.
Localizer
.
erp5_ui
.
gettext
(
msg_id
,
default
=
''
,
lang
=
lang
).
encode
(
'utf-8'
)
if
translated_message
==
''
:
msg_id
=
state
.
title
translated_message
=
context
.
Localizer
.
erp5_ui
.
gettext
(
state
.
title
.
decode
(
'utf-8'
),
lang
=
lang
).
encode
(
'utf-8'
)
key
=
(
lang
,
portal_type
.
id
,
state_var_title
,
state_id
,
msg_id
)
if
not
translated_keys
.
has_key
(
key
):
if
not
translated_keys
.
has_key
(
key
):
translated_message
=
context
.
Localizer
.
erp5_ui
.
gettext
(
state_ref
,
lang
=
lang
).
encode
(
'utf-8'
)
translated_keys
[
key
]
=
None
# mark as translated
translated_keys
[
key
]
=
None
# mark as translated
object_list
.
append
(
dict
(
language
=
lang
,
message_context
=
state_var
,
portal_type
=
pt_id
,
original_message
=
state_ref
,
object_list
.
append
(
dict
(
language
=
lang
,
message_context
=
state_var
_title
,
portal_type
=
portal_type
.
id
,
original_message
=
state_id
,
translated_message
=
translated_message
))
translated_message
=
translated_message
))
# translate state title as well
state_title
=
state
.
title
if
state_title
is
not
None
and
state_title
!=
''
:
state_var_title
=
'%s_title'
%
state_var
msg_id
=
getMessageIdWithContext
(
state_title
,
'state'
,
wf_id
)
translated_message
=
context
.
Localizer
.
erp5_ui
.
gettext
(
msg_id
,
default
=
''
,
lang
=
lang
).
encode
(
'utf-8'
)
if
translated_message
==
''
:
msg_id
=
state_title
translated_message
=
context
.
Localizer
.
erp5_ui
.
gettext
(
state_title
.
decode
(
'utf-8'
),
lang
=
lang
).
encode
(
'utf-8'
)
key
=
(
lang
,
pt_id
,
state_var_title
,
state_ref
,
msg_id
)
if
not
translated_keys
.
has_key
(
key
):
translated_keys
[
key
]
=
None
# mark as translated
object_list
.
append
(
dict
(
language
=
lang
,
message_context
=
state_var_title
,
portal_type
=
pt_id
,
original_message
=
state_ref
,
translated_message
=
translated_message
))
if
object_list
:
if
object_list
:
catalog_translation_list
(
object_list
)
catalog_translation_list
(
object_list
)
...
...
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