Skip to content

Commit

Permalink
Added notification for trans updates and added missing TR key
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramin Haeri Azad committed Jan 19, 2025
1 parent 6db37b8 commit ba9ff65
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions agate-ui/src/components/SystemCustomTranslations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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'));
});
}
Expand Down
4 changes: 2 additions & 2 deletions agate-ui/src/components/SystemPropertiesDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions agate-ui/src/i18n/en/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down Expand Up @@ -240,13 +242,17 @@ 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.',
name_exists: 'Translation key already exists',
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',
Expand Down
6 changes: 6 additions & 0 deletions agate-ui/src/i18n/fr/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -240,13 +242,17 @@ 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',
name_exists: 'La clé de traduction existe déjà',
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',
Expand Down

0 comments on commit ba9ff65

Please sign in to comment.