Commit 243a9510 authored by Jérome Perrin's avatar Jérome Perrin

crm/officejs_support_request: Fix "new support request" translation

The "New ${portal_type} created." is impossible to translate in
languages using genders for nouns, for example in french, New is
translated as "Nouveau" for masculine portal types and "Nouvelle" for
feminine portal types.

Instead, translate the full "New Support Request created." sentence.
parent 4cb13be9
portal = context.getPortalObject()
translateString = portal.Base_translateString
logged_in_user_value = portal.portal_membership.getAuthenticatedMember().getUserValue()
now = DateTime()
......@@ -69,11 +70,11 @@ for method_id in {
return support_request.Base_redirect(
keep_items={
'portal_status_message': portal.Base_translateString(
'New ${portal_type} created.',
mapping={
'portal_type': portal.Base_translateString('Support Request'),
},
'portal_status_message': translateString(
'New Support Request created.',
default=translateString(
"New ${portal_type} created.",
mapping={"portal_type": translateString("Support Request")}),
),
},
)
......@@ -7870,6 +7870,9 @@ msgstr "Nouvelle page par défaut pour la section ${web_section}."
msgid "New event created."
msgstr "Nouvel évènement créé."
msgid "New Support Request created."
msgstr "Nouvelle demande d'assistance créée."
msgid "New post created in background."
msgstr "Nouveau message créé en arrière-plan."
......
# pylint:disable=redefined-builtin
# this script uses file= argument
portal = context.getPortalObject()
translateString = portal.Base_translateString
logged_in_user_value = portal.portal_membership.getAuthenticatedMember().getUserValue()
now = DateTime()
......@@ -34,11 +35,11 @@ if description is not None or file is not None:
return support_request.Base_redirect('officejs_support_request_view',
keep_items={
'portal_status_message': portal.Base_translateString(
'New ${portal_type} created.',
mapping={
'portal_type': 'Support Request',
},
'portal_status_message': translateString(
'New Support Request created.',
default=translateString(
"New ${portal_type} created.",
mapping={"portal_type": translateString("Support Request")}),
),
},
)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment