Skip to content

Commit

Permalink
90 Add missing translations (#92)
Browse files Browse the repository at this point in the history
* fix user delete toast message translation

* i18n user slide options

* i18n profile updated
  • Loading branch information
mwarman authored Oct 18, 2024
1 parent 01b6b9f commit b4f8b5f
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/common/utils/i18n/resources/en/account.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions src/common/utils/i18n/resources/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"cancel": "Cancel",
"delete": "Delete",
"dismiss": "Dismiss",
"edit": "Edit",
"save": "Save"
},
"navigation": {
Expand Down
3 changes: 2 additions & 1 deletion src/common/utils/i18n/resources/es/account.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions src/common/utils/i18n/resources/es/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"cancel": "Cancelar",
"delete": "Borrar",
"dismiss": "Despedir",
"edit": "Editar",
"save": "Guardar"
},
"navigation": {
Expand Down
3 changes: 2 additions & 1 deletion src/common/utils/i18n/resources/fr/account.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions src/common/utils/i18n/resources/fr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"cancel": "Annuler",
"delete": "Supprimer",
"dismiss": "Rejeter",
"edit": "Modifier",
"save": "Sauvegarder"
},
"navigation": {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Account/components/Profile/ProfileForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const ProfileForm = ({
{
onSuccess: () => {
createToast({
message: 'Updated profile',
message: t('profile.updated-profile', { ns: 'account' }),
duration: 5000,
buttons: [DismissButton()],
});
Expand Down
8 changes: 5 additions & 3 deletions src/pages/Users/components/UserList/UserListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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<boolean>(false);
const { t } = useTranslation();
const { setProgress } = useProgress();
const { createToast } = useToasts();
const router = useIonRouter();
Expand Down Expand Up @@ -79,15 +81,15 @@ const UserListItem = ({ className, lines, testid, user }: UserListItemProps): JS
<IonItemOptions>
<IonItemOption className="ls-user-list-item__sliding-option" onClick={() => doEdit()}>
<Icon className="ls-user-list-item__sliding-option-icon" icon={IconName.PenToSquare} />
Edit
{t('label.edit')}
</IonItemOption>
<IonItemOption
className="ls-user-list-item__sliding-option"
color="danger"
onClick={() => setShowConfirmDelete(true)}
>
<Icon className="ls-user-list-item__sliding-option-icon" icon={IconName.Trash} />
Delete
{t('label.delete')}
</IonItemOption>
</IonItemOptions>

Expand All @@ -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}
Expand Down

0 comments on commit b4f8b5f

Please sign in to comment.