From b4f8b5f3b4a9b6f7f5cb111f160773423012c283 Mon Sep 17 00:00:00 2001 From: Matt Warman Date: Fri, 18 Oct 2024 11:45:28 -0400 Subject: [PATCH] 90 Add missing translations (#92) * fix user delete toast message translation * i18n user slide options * i18n profile updated --- src/common/utils/i18n/resources/en/account.json | 3 ++- src/common/utils/i18n/resources/en/common.json | 1 + src/common/utils/i18n/resources/es/account.json | 3 ++- src/common/utils/i18n/resources/es/common.json | 1 + src/common/utils/i18n/resources/fr/account.json | 3 ++- src/common/utils/i18n/resources/fr/common.json | 1 + src/pages/Account/components/Profile/ProfileForm.tsx | 2 +- src/pages/Users/components/UserList/UserListItem.tsx | 8 +++++--- 8 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/common/utils/i18n/resources/en/account.json b/src/common/utils/i18n/resources/en/account.json index 622725a..24c1692 100644 --- a/src/common/utils/i18n/resources/en/account.json +++ b/src/common/utils/i18n/resources/en/account.json @@ -32,7 +32,8 @@ }, "profile": "Profile", "unable-to-process": "We are experiencing problems processing your request.", - "unable-to-retrieve": "We are unable to retrieve your profile details at this time." + "unable-to-retrieve": "We are unable to retrieve your profile details at this time.", + "updated-profile": "Updated profile" }, "settings": { "font-size": { diff --git a/src/common/utils/i18n/resources/en/common.json b/src/common/utils/i18n/resources/en/common.json index 567f842..8d6efbf 100644 --- a/src/common/utils/i18n/resources/en/common.json +++ b/src/common/utils/i18n/resources/en/common.json @@ -9,6 +9,7 @@ "cancel": "Cancel", "delete": "Delete", "dismiss": "Dismiss", + "edit": "Edit", "save": "Save" }, "navigation": { diff --git a/src/common/utils/i18n/resources/es/account.json b/src/common/utils/i18n/resources/es/account.json index ca9eaaf..4d59ac8 100644 --- a/src/common/utils/i18n/resources/es/account.json +++ b/src/common/utils/i18n/resources/es/account.json @@ -32,7 +32,8 @@ }, "profile": "Perfil", "unable-to-process": "Estamos experimentando problemas al procesar su solicitud.", - "unable-to-retrieve": "No podemos recuperar los detalles de su perfil en este momento." + "unable-to-retrieve": "No podemos recuperar los detalles de su perfil en este momento.", + "updated-profile": "Perfil actualizado" }, "settings": { "font-size": { diff --git a/src/common/utils/i18n/resources/es/common.json b/src/common/utils/i18n/resources/es/common.json index 68a1300..d87a5a1 100644 --- a/src/common/utils/i18n/resources/es/common.json +++ b/src/common/utils/i18n/resources/es/common.json @@ -9,6 +9,7 @@ "cancel": "Cancelar", "delete": "Borrar", "dismiss": "Despedir", + "edit": "Editar", "save": "Guardar" }, "navigation": { diff --git a/src/common/utils/i18n/resources/fr/account.json b/src/common/utils/i18n/resources/fr/account.json index bfacfc9..ff709a0 100644 --- a/src/common/utils/i18n/resources/fr/account.json +++ b/src/common/utils/i18n/resources/fr/account.json @@ -32,7 +32,8 @@ }, "profile": "Profil", "unable-to-process": "Nous rencontrons des problèmes lors du traitement de votre demande.", - "unable-to-retrieve": "Nous ne sommes pas en mesure de récupérer les détails de votre profil pour le moment." + "unable-to-retrieve": "Nous ne sommes pas en mesure de récupérer les détails de votre profil pour le moment.", + "updated-profile": "Profil mis à jour" }, "settings": { "font-size": { diff --git a/src/common/utils/i18n/resources/fr/common.json b/src/common/utils/i18n/resources/fr/common.json index f8a68f2..5cf1d3d 100644 --- a/src/common/utils/i18n/resources/fr/common.json +++ b/src/common/utils/i18n/resources/fr/common.json @@ -9,6 +9,7 @@ "cancel": "Annuler", "delete": "Supprimer", "dismiss": "Rejeter", + "edit": "Modifier", "save": "Sauvegarder" }, "navigation": { diff --git a/src/pages/Account/components/Profile/ProfileForm.tsx b/src/pages/Account/components/Profile/ProfileForm.tsx index 584edf4..bba889b 100644 --- a/src/pages/Account/components/Profile/ProfileForm.tsx +++ b/src/pages/Account/components/Profile/ProfileForm.tsx @@ -95,7 +95,7 @@ const ProfileForm = ({ { onSuccess: () => { createToast({ - message: 'Updated profile', + message: t('profile.updated-profile', { ns: 'account' }), duration: 5000, buttons: [DismissButton()], }); diff --git a/src/pages/Users/components/UserList/UserListItem.tsx b/src/pages/Users/components/UserList/UserListItem.tsx index c803854..f5dff4c 100644 --- a/src/pages/Users/components/UserList/UserListItem.tsx +++ b/src/pages/Users/components/UserList/UserListItem.tsx @@ -8,6 +8,7 @@ import { useIonRouter, } from '@ionic/react'; import classNames from 'classnames'; +import { useTranslation } from 'react-i18next'; import './UserListItem.scss'; import { BaseComponentProps } from 'common/components/types'; @@ -42,6 +43,7 @@ interface UserListItemProps const UserListItem = ({ className, lines, testid, user }: UserListItemProps): JSX.Element => { const testIdentifier = testid ?? `list-item-user-${user.id}`; const [showConfirmDelete, setShowConfirmDelete] = useState(false); + const { t } = useTranslation(); const { setProgress } = useProgress(); const { createToast } = useToasts(); const router = useIonRouter(); @@ -79,7 +81,7 @@ const UserListItem = ({ className, lines, testid, user }: UserListItemProps): JS doEdit()}> - Edit + {t('label.edit')} setShowConfirmDelete(true)} > - Delete + {t('label.delete')} @@ -104,7 +106,7 @@ const UserListItem = ({ className, lines, testid, user }: UserListItemProps): JS createToast({ buttons: [DismissButton()], duration: 5000, - message: `${user?.name} deleted`, + message: `${user?.name} ${t('deleted')}`, }); }} user={user}