From d154b90c05e1924f81c2801849457f307cdef970 Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Wed, 15 Jan 2020 13:49:33 -0500 Subject: [PATCH] Use translations in flash messages --- atst/utils/flash.py | 14 ++++++-------- translations.yaml | 9 +++++++++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/atst/utils/flash.py b/atst/utils/flash.py index 000ff629..7a1cf4ce 100644 --- a/atst/utils/flash.py +++ b/atst/utils/flash.py @@ -129,8 +129,8 @@ MESSAGES = { "category": "success", }, "resend_portfolio_invitation_error": { - "title_template": "Portfolio invitation error", - "message_template": "There was an error processing the invitation for {{ user_name }}.", + "title": "flash.portfolio_invite.error.title", + "message": "flash.portfolio_invite.error.message", "category": "error", }, "revoked_portfolio_access": { @@ -159,15 +159,13 @@ MESSAGES = { "category": "success", }, "update_portfolio_member": { - "title_template": "Success!", - "message_template": """ - You have successfully updated access permissions for {{ member_name }}. - """, + "title": "flash.portfolio_member.update.title", + "message": "flash.portfolio_member.update.message", "category": "success", }, "update_portfolio_member_error": { - "title_template": "Permissions for {{ member_name }} could not be updated", - "message_template": "An unexpected problem occurred with your request, please try again. If the problem persists, contact an administrator.", + "title": "flash.portfolio_member.update_error.title", + "message": "flash.portfolio_member.update_error.message", "category": "error", }, "updated_application_team_settings": { diff --git a/translations.yaml b/translations.yaml index 99e2d3b0..f4a1a3fb 100644 --- a/translations.yaml +++ b/translations.yaml @@ -169,10 +169,19 @@ flash: revoked: title: Removed portfolio access message: Portfolio access successfully removed from {member_name}. + update: + title: Success! + message: You have successfully updated access permissions for {member_name}. + update_error: + title: Permissions for {member_name} could not be updated + message: An unexpected problem occurred with your request, please try again. If the problem persists, contact an administrator. portfolio_invite: resent: title: Invitation resent message: Successfully sent a new invitation to {user_name}. + error: + title: Portfolio invitation error + message: There was an error processing the invitation for {user_name}. session_expired: title: Session Expired message: Your session expired due to inactivity. Please log in again to continue.