From ba9ff656871ba1ae08f84bf018771edfed18dbf2 Mon Sep 17 00:00:00 2001 From: Ramin Haeri Azad Date: Sun, 19 Jan 2025 15:05:46 -0500 Subject: [PATCH] Added notification for trans updates and added missing TR key --- agate-ui/src/components/SystemCustomTranslations.vue | 4 ++++ agate-ui/src/components/SystemPropertiesDialog.vue | 4 ++-- agate-ui/src/i18n/en/index.js | 6 ++++++ agate-ui/src/i18n/fr/index.js | 6 ++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/agate-ui/src/components/SystemCustomTranslations.vue b/agate-ui/src/components/SystemCustomTranslations.vue index 7560d633..c4e23bf1 100644 --- a/agate-ui/src/components/SystemCustomTranslations.vue +++ b/agate-ui/src/components/SystemCustomTranslations.vue @@ -78,6 +78,7 @@ import { DefaultAlignment } from 'src/components/models'; import { translationAsMap, mapAsTranslation } from 'src/utils/translations'; import ConfirmDialog from 'src/components/ConfirmDialog.vue'; import SystemCustomTranslationsDialog from 'src/components/SystemCustomTranslationsDialog.vue'; +import { notifyError, notifySuccess } from 'src/utils/notify'; const systemStore = useSystemStore(); const { t } = useI18n(); @@ -118,6 +119,9 @@ function save() { selectedTranslations.value.splice(0); systemStore.updateTranslation(mapAsTranslation(allTranslations.value)).then(() => { systemStore.init(); + notifySuccess(t('system.translations.updated')); + }).catch(() => { + notifyError(t('system.translations.update_failed')); }); } diff --git a/agate-ui/src/components/SystemPropertiesDialog.vue b/agate-ui/src/components/SystemPropertiesDialog.vue index 319a2f23..407ea7b3 100644 --- a/agate-ui/src/components/SystemPropertiesDialog.vue +++ b/agate-ui/src/components/SystemPropertiesDialog.vue @@ -210,11 +210,11 @@ function onSave() { systemStore .save(configuration.value) .then(() => { - notifySuccess(t('user.password_updated')); + notifySuccess(t('system.updated')); emit('saved'); }) .catch(() => { - notifyError(t('user.password_update_failed')); + notifyError(t('system.update_failed')); }) .finally(() => { emit('update:modelValue', false); diff --git a/agate-ui/src/i18n/en/index.js b/agate-ui/src/i18n/en/index.js index 77234aeb..16674b32 100644 --- a/agate-ui/src/i18n/en/index.js +++ b/agate-ui/src/i18n/en/index.js @@ -96,6 +96,8 @@ export default { PENDING: 'User is pending approval.', }, update_password: 'Update password', + password_updated: 'Password updated', + password_update_failed: 'Failed to update password', attributes: { title: 'User Attributes', hint: 'Additional user information.', @@ -240,6 +242,8 @@ export default { signup_whitelist: 'Signup whitelist', sso_domain_hint: 'Single sign-on domain.', sso_domain: 'SSO Domain', + updated: 'Settings updated', + update_failed: 'Failed to update settings', translations: { title: 'Custom Translations', hint: 'Override the default translations or add new ones.', @@ -247,6 +251,8 @@ export default { name_hint: "Use '.' for grouping (e.g., 'address.street', 'address.city')", add: 'Add Translation', remove_confirm: 'Please confirm the removal of the translation | Please confirm the removal of the {count} translations', + updated: 'Translation updated successfully', + update_failed: 'Failed to update translation', }, otp_strategies: { NONE: 'None', diff --git a/agate-ui/src/i18n/fr/index.js b/agate-ui/src/i18n/fr/index.js index 98762aa8..322fe197 100644 --- a/agate-ui/src/i18n/fr/index.js +++ b/agate-ui/src/i18n/fr/index.js @@ -96,6 +96,8 @@ export default { PENDING: "Usager en attente d'approbation.", }, update_password: 'Mettre à jour le mot de passe', + password_updated: 'Mot de passe mis à jour', + password_update_failed: "Échec de la mise à jour du mot de passe", attributes: { title: 'Attributs utilisateur', hint: "Informations additionnelles sur l'usager.", @@ -240,6 +242,8 @@ export default { signup_whitelist: "Liste blanche d'inscription", sso_domain_hint: 'Domaine de connexion unique.', sso_domain: 'Domaine SSO', + updated: 'Paramètres mis à jour', + update_failed: 'Échec de la mise à jour des paramètres', translations: { title: 'Traductions personnalisés', hint: 'Remplacer les traductions par défaut ou en ajouter de nouvelles', @@ -247,6 +251,8 @@ export default { name_hint: "Utiliser '.' pour le regroupement (ex. : 'adresse.rue', 'adresse.ville')", add: 'Ajouter une traduction', remove_confirm: 'Veuillez confirmer la suppression de la traduction | Veuillez confirmer la suppression des {count} traductions', + updated: 'Traductions mises à jour', + update_failed: 'Échec de la mise à jour des traductions', }, otp_strategies: { NONE: 'Aucun',