Skip to content

Commit

Permalink
refactor(user_account): added translations for delete account feature
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrySakalouski committed Oct 26, 2023
1 parent 9bcfcdd commit 46106bb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
8 changes: 8 additions & 0 deletions assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,14 @@
"upload_logs": "Upload Logs",
"delete_account": "Request account deletion"
},
"delete_user_account": {
"request": "Request Account Deletion",
"delete_data": "Delete your account and data? All data will be permanently deleted and cannot be restored.",
"cancel": "No, cancel",
"confirm": "Yes, delete",
"request_sent": "Account Deletion Request sent",
"what_to_know": "What to know:\nDeleting your account will also permanently delete all of your data. After you ask to delete your account, the process takes up to 24 hours. During this time, you will be logged out, and your account access will be blocked. If you change your mind about deleting your account, please contact us."
},
"language_screen": {
"app_language": "Application language",
"change_app_language": "Change Language",
Expand Down
8 changes: 8 additions & 0 deletions assets/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@
"upload_logs": "Télécharger les journaux",
"delete_account": "Request account deletion"
},
"delete_user_account": {
"request": "Demande de Suppression de Compte",
"delete_data": "Supprimer votre compte et vos données? Toutes les données seront définitivement supprimées et ne pourront pas être récupérées.",
"cancel": "Non, annuler",
"confirm": "Oui, supprimer",
"request_sent": "Requête de suppression de compte envoyée",
"what_to_know": "Ce qu'il faut savoir :\n Supprimer votre compte entraînera également la suppression définitive de l'ensemble de vos données. Après avoir demandé la suppression de votre compte, le processus peut prendre jusqu'à 24 heures. Pendant ce temps, vous serez déconnecté(e), et l'accès à votre compte sera bloqué. Si vous changez d'avis concernant la suppression de votre compte, veuillez nous contacter."
},
"sign_up_form": {
"sign_up": "S'inscrire",
"error": "L'inscription a échoué : le nom d'utilisateur est peut-être déjà utilisé.",
Expand Down
17 changes: 8 additions & 9 deletions src/shared/lib/alerts/deleteAccountAlert.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { Alert } from 'react-native';

import i18n from 'i18next';

export function onDeleteAccount(onConfirm: () => void) {
Alert.alert(
'Account Deletion Request',
'Are you sure you want to delete your account? All data will be permanently deleted',
i18n.t('delete_user_account:request'),
i18n.t('delete_user_account:delete_data'),
[
{
text: 'Cancel',
text: i18n.t('delete_user_account:cancel'),
},
{
text: 'Yes, delete',
text: i18n.t('delete_user_account:confirm'),
onPress: onConfirm,
},
],
Expand All @@ -18,11 +20,8 @@ export function onDeleteAccount(onConfirm: () => void) {

export function onDeleteAccountConfirmed() {
Alert.alert(
'Account Deletion Request Has Been Sent',
`Account Deletion takes up to 24 hours.\n\n
During this time, you will be logged out, and access to your account will be blocked.\n\n
If you change your mind please contact us
`,
i18n.t('delete_user_account:request_sent'),
i18n.t('delete_user_account:what_to_know'),
[
{
text: 'Ok',
Expand Down

0 comments on commit 46106bb

Please sign in to comment.