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() 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")}),
), ),
}, },
) )
...@@ -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."
......
# 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")}),
), ),
}, },
) )
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