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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Klaus Wölfel
erp5
Commits
d496ed17
Commit
d496ed17
authored
Sep 07, 2018
by
Cédric Le Ninivin
Committed by
Klaus Wölfel
Apr 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Translation: Add portal_type translation customization on transition title
parent
c017e270
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
4 deletions
+27
-4
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
...rtal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
+2
-1
product/ERP5Type/Utils.py
product/ERP5Type/Utils.py
+14
-0
product/ERP5Type/__init__.py
product/ERP5Type/__init__.py
+1
-1
product/ERP5Type/patches/DCWorkflow.py
product/ERP5Type/patches/DCWorkflow.py
+10
-2
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
View file @
d496ed17
...
@@ -1511,7 +1511,8 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
...
@@ -1511,7 +1511,8 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
'href'
:
'%s'
%
view_action
[
'url'
],
'href'
:
'%s'
%
view_action
[
'url'
],
'name'
:
view_action
[
'id'
],
'name'
:
view_action
[
'id'
],
'icon'
:
view_action
[
'icon'
],
'icon'
:
view_action
[
'icon'
],
'title'
:
Base_translateString
(
view_action
[
'title'
]),
'title'
:
Base_translateString
(
view_action
[
'title'
])
\
if
erp5_action_key
!=
"workflow"
else
view_action
[
'title'
],
})
})
global_action_type
=
(
"view"
,
"workflow"
,
"object_new_content_action"
,
global_action_type
=
(
"view"
,
"workflow"
,
"object_new_content_action"
,
...
...
product/ERP5Type/Utils.py
View file @
d496ed17
...
@@ -386,6 +386,20 @@ def getTranslatedWorkflowStateWithPortalType(localizer, workflow_id, lang,
...
@@ -386,6 +386,20 @@ def getTranslatedWorkflowStateWithPortalType(localizer, workflow_id, lang,
if
translated_message
:
if
translated_message
:
return
translated_message
,
msg_id
return
translated_message
,
msg_id
def
getWorkflowTransitionTranslatedTitle
(
localizer
,
workflow_id
,
lang
,
portal_type
,
transition_title
):
for
msg_id
,
default
in
[
(
getMessageIdWithContext
(
transition_title
,
'transition'
,
portal_type
),
''
),
(
getMessageIdWithContext
(
transition_title
,
'transition'
,
workflow_id
),
''
),
(
transition_title
.
decode
(
'utf-8'
),
None
),
]:
translated_message
=
localizer
.
erp5_ui
.
gettext
(
msg_id
,
default
=
default
,
lang
=
lang
).
encode
(
'utf-8'
)
if
translated_message
:
return
translated_message
,
msg_id
#Get translation of msg id
#Get translation of msg id
def
getTranslationStringWithContext
(
self
,
msg_id
,
context
,
context_id
):
def
getTranslationStringWithContext
(
self
,
msg_id
,
context
,
context_id
):
...
...
product/ERP5Type/__init__.py
View file @
d496ed17
...
@@ -170,7 +170,7 @@ ModuleSecurityInfo('Products.ERP5Type.Utils').declarePublic(
...
@@ -170,7 +170,7 @@ ModuleSecurityInfo('Products.ERP5Type.Utils').declarePublic(
'sortValueList'
,
'convertToUpperCase'
,
'UpperCase'
,
'sortValueList'
,
'convertToUpperCase'
,
'UpperCase'
,
'convertToMixedCase'
,
'cartesianProduct'
,
'sleep'
,
'getCommonTimeZoneList'
,
'convertToMixedCase'
,
'cartesianProduct'
,
'sleep'
,
'getCommonTimeZoneList'
,
'int2letter'
,
'getMessageIdWithContext'
,
'getTranslationStringWithContext'
,
'int2letter'
,
'getMessageIdWithContext'
,
'getTranslationStringWithContext'
,
'getTranslatedWorkflowStateWithPortalType'
,
'getTranslatedWorkflowStateWithPortalType'
,
'getWorkflowTransitionTranslatedTitle'
,
'Email_parseAddressHeader'
,
'guessEncodingFromText'
,
'Email_parseAddressHeader'
,
'guessEncodingFromText'
,
'isValidTALESExpression'
)
'isValidTALESExpression'
)
...
...
product/ERP5Type/patches/DCWorkflow.py
View file @
d496ed17
...
@@ -33,7 +33,7 @@ from Products.CMFCore.utils import _getAuthenticatedUser
...
@@ -33,7 +33,7 @@ from Products.CMFCore.utils import _getAuthenticatedUser
from
DocumentTemplate.DT_Util
import
TemplateDict
from
DocumentTemplate.DT_Util
import
TemplateDict
from
DateTime
import
DateTime
from
DateTime
import
DateTime
from
Products.ERP5Type.Cache
import
CachingMethod
from
Products.ERP5Type.Cache
import
CachingMethod
from
Products.ERP5Type.Utils
import
convertToMixedCase
from
Products.ERP5Type.Utils
import
convertToMixedCase
,
getWorkflowTransitionTranslatedTitle
import
sys
import
sys
from
Acquisition
import
aq_base
from
Acquisition
import
aq_base
from
copy
import
deepcopy
from
copy
import
deepcopy
...
@@ -243,9 +243,17 @@ def DCWorkflowDefinition_listObjectActions(self, info):
...
@@ -243,9 +243,17 @@ def DCWorkflowDefinition_listObjectActions(self, info):
fmt_data
=
TemplateDict
()
fmt_data
=
TemplateDict
()
fmt_data
.
_push
(
info
)
fmt_data
.
_push
(
info
)
fmt_data
.
_push
({
'transition_id'
:
transition_id
})
fmt_data
.
_push
({
'transition_id'
:
transition_id
})
localizer
=
ob
.
getPortalObject
().
Localizer
selected_language
=
localizer
.
get_selected_language
()
transition_title
=
getWorkflowTransitionTranslatedTitle
(
localizer
,
self
.
id
,
selected_language
,
ob
.
getPortalType
(),
tdef
.
actbox_name
%
fmt_data
,
)[
0
]
result
.
append
({
result
.
append
({
'id'
:
transition_id
,
'id'
:
transition_id
,
'name'
:
t
def
.
actbox_name
%
fmt_data
,
'name'
:
t
ransition_title
,
'url'
:
tdef
.
actbox_url
%
fmt_data
,
'url'
:
tdef
.
actbox_url
%
fmt_data
,
'icon'
:
tdef
.
actbox_icon
%
fmt_data
,
'icon'
:
tdef
.
actbox_icon
%
fmt_data
,
'permissions'
:
(),
# Predetermined.
'permissions'
:
(),
# Predetermined.
...
...
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