Skip to content

Commit

Permalink
Added notification for trans updates and added missing TR key (#593)
Browse files Browse the repository at this point in the history
* Added notification for trans updates and added missing TR key

* Removed dup and unused TR keys

---------

Co-authored-by: Ramin Haeri Azad <[email protected]>
  • Loading branch information
kazoompa and Ramin Haeri Azad authored Jan 20, 2025
1 parent f15624c commit 425cbe5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 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
2 changes: 2 additions & 0 deletions agate-ui/src/i18n/en/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,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',
Expand Down
2 changes: 2 additions & 0 deletions agate-ui/src/i18n/fr/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,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',
Expand Down

0 comments on commit 425cbe5

Please sign in to comment.