From 8f33177dad523bfe863aef21c5587ccabc4462a5 Mon Sep 17 00:00:00 2001 From: Alexandro Uc Santos Date: Sat, 25 May 2024 18:14:17 -0600 Subject: [PATCH] translations users & directory --- src/components/CardLocation.vue | 38 ++-- src/components/CardUser.vue | 68 ++++--- src/components/CreateLocationModal.vue | 10 +- src/components/CreateUserModal.vue | 50 ++--- src/components/ui/EditCompanyModal.vue | 36 ++-- src/components/ui/Notification.vue | 5 +- src/i18n/en.js | 197 ++++++++++++++++++ src/i18n/es.js | 199 +++++++++++++++++++ src/i18n/i18n.js | 265 +------------------------ src/stores/company.js | 24 ++- src/stores/vehicles.js | 8 +- src/views/LocationsView.vue | 21 +- src/views/MyCompanyView.vue | 4 +- src/views/UsersView.vue | 9 +- 14 files changed, 549 insertions(+), 385 deletions(-) create mode 100644 src/i18n/en.js create mode 100644 src/i18n/es.js diff --git a/src/components/CardLocation.vue b/src/components/CardLocation.vue index 4ad2d2a..de15315 100644 --- a/src/components/CardLocation.vue +++ b/src/components/CardLocation.vue @@ -2,6 +2,7 @@ import Swal from 'sweetalert2'; import { useCompanyStore } from '../stores/company'; import { useAuthStore } from '../stores/auth'; + import { useI18n } from 'vue-i18n'; const props = defineProps({ location: { @@ -14,21 +15,22 @@ const companyStore = useCompanyStore(); const authStore = useAuthStore(); + const { t } = useI18n(); const handleDeleteLocation = async() => { Swal.fire({ - title: 'Eliminar Locación!', - text: '¿Estás seguro de eliminar este locación?', + title: t('directory.titleDel'), + text: t('directory.textDel'), icon: 'warning', showCancelButton: true, cancelButtonColor: "#d33", - confirmButtonText: 'Eliminar', - cancelButtonText: 'Cancelar', + confirmButtonText: t('buttons.delete'), + cancelButtonText: t('buttons.cancel'), }).then(async(result) => { if(result.isConfirmed) { Swal.fire({ - title: 'Por favor espere!', - html: 'Eliminando locación...',// add html attribute if you want or remove + title: t('messages.loading'), + html: t('directory.loadingDel') + '..',// add html attribute if you want or remove allowOutsideClick: false, didOpen: () => { Swal.showLoading() @@ -41,14 +43,14 @@ if(resp != null) { Swal.fire({ - title: "Locación eliminado!", - text: "Tu locación ha sido eliminado exitosamente.", + title: t('directory.msgTitleDel'), + text: t('directory.msgDel'), icon: "success" }); } else { Swal.fire({ - title: "No eliminado!", - text: "Tu locación no se pudo eliminar, intente más tarde.", + title: t('errors.msgTitleNotDel'), + text: t('directory.msgNotDel'), icon: "error" }); } @@ -62,12 +64,12 @@ diff --git a/src/components/CreateLocationModal.vue b/src/components/CreateLocationModal.vue index bed6060..3dd7ce3 100644 --- a/src/components/CreateLocationModal.vue +++ b/src/components/CreateLocationModal.vue @@ -9,6 +9,7 @@ import { useAuthStore } from '../stores/auth'; import { useCompanyStore } from '../stores/company'; import Swal from 'sweetalert2'; + import { useI18n } from 'vue-i18n'; const props = defineProps({ location: { @@ -21,11 +22,12 @@ const authStore = useAuthStore(); const companyStore = useCompanyStore() + const { t } = useI18n() const loading = ref(false); const title = computed(() => { - return (props.location) ? 'Editar Locación' : 'Crear Locación'; + return (props.location) ? t('directory.editLocation') : t('directory.createLocation'); }); const initState = { @@ -167,7 +169,7 @@ :error="errors.branch_name" />
- +
- +