feat(invite): i18n create/destroy

This commit is contained in:
Martin 2024-02-20 17:20:04 +01:00
parent 284ecf864b
commit 11eb0a9c56
3 changed files with 13 additions and 3 deletions

View file

@ -15,7 +15,7 @@ class InvitesController < ApplicationController
if invite.valid?
# The notification is sent through an after commit hook in order to avoir concurrency issues
flash.notice = "Une invitation a été envoyée à #{invite.email}."
flash.notice = t('views.invites.create.success', email: invite.email)
else
flash.alert = invite.errors.full_messages
end
@ -49,9 +49,9 @@ class InvitesController < ApplicationController
if invite.present?
@dossier = invite.dossier
invite.destroy!
flash.notice = "Lautorisation de #{invite.email} vient dêtre révoquée."
flash.notice = t('views.invites.destroy.success', email: invite.email)
else
flash.alert = "Vous ne pouvez pas révoquer cette autorisation"
flash.alert = t('views.invites.destroy.error')
end
respond_to do |format|

View file

@ -311,6 +311,11 @@ en:
resent: 'Resend the confirmation email'
faq: 'Also, you can check our'
invites:
create:
success: "One invitation has been sent to %{email}."
destroy:
success: "The permission given to %{email} had been revoked."
error: "You can't revoke this invitation"
dropdown:
invite_to_edit: Invite someone to edit this file
view_invited_people: "View invited people"

View file

@ -307,6 +307,11 @@ fr:
resent: 'Renvoyer un email de confirmation'
faq: 'Vous pouvez également consulter notre'
invites:
create:
success: "Une invitation a été envoyée à %{email}."
destroy:
success: "Lautorisation de %{email} vient dêtre révoquée."
error: "Vous ne pouvez pas révoquer cette autorisation"
dropdown:
invite_to_edit: Inviter une personne à modifier ce dossier
view_invited_people: "Voir les personnes invitées"