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
Labels
Merge Requests
137
Merge Requests
137
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
349258e5
Commit
349258e5
authored
Aug 12, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Plain Diff
Fix translations with ${portal_type} variables
See merge request
nexedi/erp5!1236
parents
a52c7d5d
27238127
Pipeline
#10958
passed with stage
in 0 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
55 additions
and
41 deletions
+55
-41
bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Base_addSupportRequest.py
...plateItem/portal_skins/erp5_crm/Base_addSupportRequest.py
+6
-5
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Invoice_jumpToOrder.py
...teItem/portal_skins/erp5_invoicing/Invoice_jumpToOrder.py
+5
-4
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Order_jumpToInvoice.py
...teItem/portal_skins/erp5_invoicing/Order_jumpToInvoice.py
+5
-4
bt5/erp5_l10n_fr/MessageTranslationTemplateItem/fr/erp5_ui/translation.po
.../MessageTranslationTemplateItem/fr/erp5_ui/translation.po
+3
-0
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequestModule_createSupportRequest.py
...port_request/SupportRequestModule_createSupportRequest.py
+6
-5
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Organisation_jumpToRelatedObjectList.py
...al_skins/erp5_pdm/Organisation_jumpToRelatedObjectList.py
+15
-13
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Organisation_jumpToRelatedObjectList.xml
...l_skins/erp5_pdm/Organisation_jumpToRelatedObjectList.xml
+1
-1
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_jumpToRelatedTransformation.py
...al_skins/erp5_pdm/Resource_jumpToRelatedTransformation.py
+13
-8
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_jumpToRelatedTransformation.xml
...l_skins/erp5_pdm/Resource_jumpToRelatedTransformation.xml
+1
-1
No files found.
bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Base_addSupportRequest.py
View file @
349258e5
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
translateString
=
portal
.
Base_translateString
logged_in_user_value
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
logged_in_user_value
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
now
=
DateTime
()
now
=
DateTime
()
...
@@ -69,11 +70,11 @@ for method_id in {
...
@@ -69,11 +70,11 @@ for method_id in {
return
support_request
.
Base_redirect
(
return
support_request
.
Base_redirect
(
keep_items
=
{
keep_items
=
{
'portal_status_message'
:
portal
.
Base_
translateString
(
'portal_status_message'
:
translateString
(
'New
${portal_type}
created.'
,
'New
Support Request
created.'
,
mapping
=
{
default
=
translateString
(
'portal_type'
:
portal
.
Base_translateString
(
'Support Request'
)
,
"New ${portal_type} created."
,
}
,
mapping
=
{
"portal_type"
:
translateString
(
"Support Request"
)})
,
),
),
},
},
)
)
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Invoice_jumpToOrder.py
View file @
349258e5
...
@@ -36,7 +36,8 @@ if related_order_uid_list:
...
@@ -36,7 +36,8 @@ if related_order_uid_list:
keep_items
=
dict
(
reset
=
1
,
keep_items
=
dict
(
reset
=
1
,
uid
=
related_order_uid_list
))
uid
=
related_order_uid_list
))
return
context
.
Base_redirect
(
form_id
,
return
context
.
Base_redirect
(
form_id
,
keep_items
=
dict
(
keep_items
=
dict
(
portal_status_message
=
portal_status_message
=
translateString
(
translateString
(
'No ${portal_type} related.'
,
'No %s Related'
%
order_type
,
mapping
=
dict
(
portal_type
=
translateString
(
order_type
)))))
default
=
translateString
(
'No ${portal_type} related.'
,
mapping
=
{
'portal_type'
:
translateString
(
order_type
)}))))
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/Order_jumpToInvoice.py
View file @
349258e5
...
@@ -37,7 +37,8 @@ if related_invoice_uid_list:
...
@@ -37,7 +37,8 @@ if related_invoice_uid_list:
keep_items
=
dict
(
reset
=
1
,
keep_items
=
dict
(
reset
=
1
,
uid
=
related_invoice_uid_list
))
uid
=
related_invoice_uid_list
))
return
context
.
Base_redirect
(
form_id
,
return
context
.
Base_redirect
(
form_id
,
keep_items
=
dict
(
keep_items
=
dict
(
portal_status_message
=
portal_status_message
=
translateString
(
translateString
(
'No ${portal_type} related.'
,
'No %s Related'
%
invoice_type
,
mapping
=
dict
(
portal_type
=
translateString
(
invoice_type
)))))
default
=
translateString
(
'No ${portal_type} related.'
,
mapping
=
{
'portal_type'
:
translateString
(
invoice_type
)}))))
bt5/erp5_l10n_fr/MessageTranslationTemplateItem/fr/erp5_ui/translation.po
View file @
349258e5
...
@@ -7870,6 +7870,9 @@ msgstr "Nouvelle page par défaut pour la section ${web_section}."
...
@@ -7870,6 +7870,9 @@ msgstr "Nouvelle page par défaut pour la section ${web_section}."
msgid "New event created."
msgid "New event created."
msgstr "Nouvel évènement créé."
msgstr "Nouvel évènement créé."
msgid "New Support Request created."
msgstr "Nouvelle demande d'assistance créée."
msgid "New post created in background."
msgid "New post created in background."
msgstr "Nouveau message créé en arrière-plan."
msgstr "Nouveau message créé en arrière-plan."
...
...
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequestModule_createSupportRequest.py
View file @
349258e5
# pylint:disable=redefined-builtin
# pylint:disable=redefined-builtin
# this script uses file= argument
# this script uses file= argument
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
translateString
=
portal
.
Base_translateString
logged_in_user_value
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
logged_in_user_value
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
now
=
DateTime
()
now
=
DateTime
()
...
@@ -34,11 +35,11 @@ if description is not None or file is not None:
...
@@ -34,11 +35,11 @@ if description is not None or file is not None:
return
support_request
.
Base_redirect
(
'officejs_support_request_view'
,
return
support_request
.
Base_redirect
(
'officejs_support_request_view'
,
keep_items
=
{
keep_items
=
{
'portal_status_message'
:
portal
.
Base_
translateString
(
'portal_status_message'
:
translateString
(
'New
${portal_type}
created.'
,
'New
Support Request
created.'
,
mapping
=
{
default
=
translateString
(
'portal_type'
:
'Support Request'
,
"New ${portal_type} created."
,
}
,
mapping
=
{
"portal_type"
:
translateString
(
"Support Request"
)})
,
),
),
},
},
)
)
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Organisation_jumpToRelatedObjectList.py
View file @
349258e5
...
@@ -25,22 +25,24 @@ related_object_list = context.getRelatedValueList(
...
@@ -25,22 +25,24 @@ related_object_list = context.getRelatedValueList(
portal_type
=
portal_type
)
portal_type
=
portal_type
)
if
not
related_object_list
:
if
not
related_object_list
:
message
=
portal
.
Base_translateString
(
'No ${portal_type} related.'
,
return
context
.
Base_redirect
(
form_id
,
keep_items
=
dict
(
mapping
=
{
'portal_type'
:
portal_type
})
portal_status_message
=
portal
.
Base_translateString
(
'No %s Related'
%
portal_type
,
return
context
.
Base_redirect
(
keep_items
=
dict
(
portal_status_message
=
message
))
default
=
portal
.
Base_translateString
(
'No ${portal_type} related.'
,
mapping
=
{
'portal_type'
:
portal
.
Base_translateString
(
portal_type
)}))))
elif
len
(
related_object_list
)
==
1
:
elif
len
(
related_object_list
)
==
1
:
related_object
=
related_object_list
[
0
]
related_object
=
related_object_list
[
0
]
message
=
portal
.
Base_translateString
(
return
related_object
.
Base_redirect
(
keep_items
=
dict
(
'${this_portal_type} related to ${that_portal_type}: ${that_title}.'
,
reset
=
1
,
mapping
=
{
"this_portal_type"
:
related_object
.
getTranslatedPortalType
(),
portal_status_message
=
portal
.
Base_translateString
(
"that_portal_type"
:
context
.
getTranslatedPortalType
(),
# first, try to get a full translated message with portal types
"that_title"
:
context
.
getTitleOrId
()})
"%s related to %s."
%
(
related_object
.
getPortalType
(),
context
.
getPortalType
()),
# if not found, fallback to generic translation
return
related_object
.
Base_redirect
(
default
=
portal
.
Base_translateString
(
'${this_portal_type} related to ${that_portal_type} : ${that_title}.'
,
keep_items
=
dict
(
reset
=
1
,
mapping
=
{
"this_portal_type"
:
related_object
.
getTranslatedPortalType
(),
portal_status_message
=
message
))
"that_portal_type"
:
context
.
getTranslatedPortalType
(),
"that_title"
:
context
.
getTitleOrId
()}))))
else
:
else
:
# XXX: Use POST rather than GET because of GET URL length limitation?
# XXX: Use POST rather than GET because of GET URL length limitation?
...
...
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Organisation_jumpToRelatedObjectList.xml
View file @
349258e5
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
portal_type
</string>
</value>
<value>
<string>
portal_type
, form_id=\'\'
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_jumpToRelatedTransformation.py
View file @
349258e5
...
@@ -4,19 +4,24 @@ transformation_value_list = context.getRelatedValueList(checked_permission='View
...
@@ -4,19 +4,24 @@ transformation_value_list = context.getRelatedValueList(checked_permission='View
portal_type
=
(
'Transformation'
,
portal_type
=
(
'Transformation'
,
'Transformation Transformed Resource'
))
'Transformation Transformed Resource'
))
if
len
(
transformation_value_list
)
==
0
:
if
len
(
transformation_value_list
)
==
0
:
return
context
.
Base_redirect
(
'view'
,
return
context
.
Base_redirect
(
form_id
,
keep_items
=
dict
(
portal_status_message
=
translateString
(
'No Transformation related.'
)))
keep_items
=
dict
(
portal_status_message
=
translateString
(
'No Transformation related.'
)))
elif
len
(
transformation_value_list
)
==
1
:
elif
len
(
transformation_value_list
)
==
1
:
related_object
=
transformation_value_list
[
0
]
related_object
=
transformation_value_list
[
0
]
if
related_object
.
getPortalType
()
==
'Transformation Transformed Resource'
:
if
related_object
.
getPortalType
()
==
'Transformation Transformed Resource'
:
related_object
=
related_object
.
getParentValue
()
related_object
=
related_object
.
getParentValue
()
return
related_object
.
Base_redirect
(
'view'
,
return
related_object
.
Base_redirect
(
keep_items
=
dict
(
keep_items
=
dict
(
reset
=
1
,
reset
=
1
,
portal_status_message
=
translateString
(
'${this_portal_type} related to ${that_portal_type} : ${that_title}.'
,
portal_status_message
=
portal
.
Base_translateString
(
mapping
=
{
"this_portal_type"
:
related_object
.
getTranslatedPortalType
(),
# first, try to get a full translated message with portal types
"that_portal_type"
:
context
.
getTranslatedPortalType
(),
"%s related to %s."
%
(
related_object
.
getPortalType
(),
context
.
getPortalType
()),
"that_title"
:
context
.
getTitleOrId
()})))
# if not found, fallback to generic translation
default
=
translateString
(
'${this_portal_type} related to ${that_portal_type} : ${that_title}.'
,
mapping
=
{
"this_portal_type"
:
related_object
.
getTranslatedPortalType
(),
"that_portal_type"
:
context
.
getTranslatedPortalType
(),
"that_title"
:
context
.
getTitleOrId
()}))))
else
:
else
:
transformation_uid_list
=
[]
transformation_uid_list
=
[]
for
value
in
transformation_value_list
:
for
value
in
transformation_value_list
:
...
...
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_jumpToRelatedTransformation.xml
View file @
349258e5
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
<value>
<string>
form_id=\'\'
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
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