diff --git a/src/i18n/ca-ES/index.js b/src/i18n/ca-ES/index.js index 5d4caa1e..58bab70c 100644 --- a/src/i18n/ca-ES/index.js +++ b/src/i18n/ca-ES/index.js @@ -40,25 +40,35 @@ export default { ] }, of: 'de', - // Menu - home: 'Inici', - catalog: 'Catàleg', - pendingOrders: 'Comandes pendents', - confirmedOrders: 'Comandes confirmades', - invoices: 'Factures', - agencyPackages: 'Paquets per agència', - accountConfig: 'Configuració', - addressesList: 'Adreces', - addressDetails: 'Configuració', - checkout: 'Configurar encàrrec', - controlPanel: 'Panell de control', - adminConnections: 'Connexions', - adminItems: 'Articles', - adminVisits: 'Visites', - adminUsers: "Gestió d'usuaris", - adminPhotos: 'Imatges', - adminNews: 'Gestió de noticies', - adminNewsDetails: 'Afegir o editar notícia', + + // Sections titles + Home: 'Inici', + Orders: 'Comandes', + Ticket: `Detall de l'encarrec`, + 'Pending orders': 'Comandes pendents', + 'Last orders': 'Comandes confirmades', + Invoices: 'Factures', + Basket: 'Cistella', + Catalog: 'Catàleg', + Administration: 'Administració', + 'Control panel': 'Panell de control', + Users: 'Usuaris', + Connections: 'Connexions', + Visits: 'Visites', + News: 'Notícies', + Photos: 'Imatges', + Images: 'Imatges', + Items: 'Articles', + Agencies: 'Agències', + Reports: 'Informes', + Configuration: 'Configuració', + Shelves: 'Prestatgeries', + Account: 'Compte', + Addresses: 'Adreces', + Confirm: 'Confirmar', + Checkout: `Configurar l'encarrec`, + 'Address details': 'Configuració', + 'Admin news details': `Afegir o editar notícia`, // orderLoadedIntoBasket: 'Comanda carregada a la cistella!', loadAnOrder: @@ -71,7 +81,7 @@ export default { noData: 'Sense dades', confirm: 'Confirmar', delete: 'Esborrar', - reallyDelete: 'Estàs segur que vols esborrar la línia?', emptyList: 'Llista buida', - modify: 'Modificar' + modify: 'Modificar', + confirmDelete: 'Estàs segur que vols esborrar la línia?' }; diff --git a/src/i18n/en-US/index.js b/src/i18n/en-US/index.js index 3022620b..fec4659c 100644 --- a/src/i18n/en-US/index.js +++ b/src/i18n/en-US/index.js @@ -53,25 +53,34 @@ export default { ] }, - // menu - home: 'Home', - catalog: 'Catalog', - pendingOrders: 'Pending orders', - confirmedOrders: 'Confirmed orders', - invoices: 'Invoices', - agencyPackages: 'Bundles by agency', - accountConfig: 'Configuration', - addressesList: 'Addresses', - addressDetails: 'Configuration', - checkout: 'Configure order', - controlPanel: 'Control panel', - adminConnections: 'Connections', - adminItems: 'Items', - adminVisits: 'Visits', - adminUsers: 'User management', - adminPhotos: 'Images', - adminNews: 'News management', - adminNewsDetails: 'Add or edit new', + // Sections titles + Home: 'Home', + Orders: 'Orders', + Ticket: 'Detalle del pedido', + 'Pending orders': 'Pending orders', + 'Last orders': 'Confirmed orders', + Invoices: 'Invoices', + Basket: 'Basket', + Catalog: 'Catalog', + Administration: 'Administration', + 'Control panel': 'Control panel', + Users: 'Users', + Connections: 'Connections', + Visits: 'Visits', + News: 'News', + Photos: 'Images', + Images: 'Images', + Items: 'Items', + Agencies: 'Agencies', + Reports: 'Reports', + Configuration: 'Configuration', + Shelves: 'Shelves', + Account: 'Account', + Addresses: 'Addresses', + Confirm: 'Confirm', + Checkout: 'Configure order', + 'Address details': 'Configuration', + 'Admin news details': 'Add or edit new', // orderLoadedIntoBasket: 'Order loaded into basket!', loadAnOrder: 'Please load a pending order to the cart or start a new one', @@ -83,7 +92,8 @@ export default { noData: 'No data', confirm: 'Confirm', delete: 'Delete', - reallyDelete: 'Are you sure you want to delete the line?', + confirmDelete: 'Are you sure you want to delete the line?', + emptyList: 'Empty list', orders: 'Orders', order: 'Pending order', @@ -107,6 +117,5 @@ export default { save: 'Save', cancel: 'Cancel', of: 'of', - emptyList: 'Empty list', modify: 'Modify' }; diff --git a/src/i18n/es-ES/index.js b/src/i18n/es-ES/index.js index f1ee68b5..03879535 100644 --- a/src/i18n/es-ES/index.js +++ b/src/i18n/es-ES/index.js @@ -59,25 +59,34 @@ export default { ] }, - // Menu - home: 'Inicio', - catalog: 'Catálogo', - pendingOrders: 'Pedidos pendientes', - confirmedOrders: 'Pedidos confirmados', - invoices: 'Facturas', - agencyPackages: 'Bultos por agencia', - accountConfig: 'Configuración', - addressesList: 'Direcciones', - addressDetails: 'Configuración', - checkout: 'Configurar pedido', - controlPanel: 'Panel de control', - adminConnections: 'Conexiones', - adminItems: 'Artículos', - adminVisits: 'Visitas', - adminUsers: 'Gestión de usuarios', - adminPhotos: 'Imágenes', - adminNews: 'Gestión de noticias', - adminNewsDetails: 'Añadir o editar noticia', + // Sections titles + Home: 'Inicio', + Orders: 'Pedidos', + Ticket: 'Pedido', + 'Pending orders': 'Pedidos pendientes', + 'Last orders': 'Pedidos confirmados', + Invoices: 'Facturas', + Basket: 'Cesta', + Catalog: 'Catálogo', + Administration: 'Administración', + 'Control panel': 'Panel de control', + Users: 'Usuarios', + Connections: 'Conexiones', + Visits: 'Visitas', + News: 'Noticias', + Photos: 'Imágenes', + Images: 'Imágenes', + Items: 'Artículos', + Agencies: 'Agencias', + Reports: 'Informes', + Configuration: 'Configuración', + Shelves: 'Estanterías', + Account: 'Cuenta', + Addresses: 'Direcciones', + Confirm: 'Confirmar', + Checkout: 'Configurar pedido', + 'Address details': 'Configuración', + 'Admin news details': 'Añadir o editar noticia', // orderLoadedIntoBasket: '¡Pedido cargado en la cesta!', loadAnOrder: @@ -90,7 +99,8 @@ export default { noData: 'Sin datos', confirm: 'Confirmar', delete: 'Borrar', - reallyDelete: '¿Estás seguro de que quieres borrar la línea?', + confirmDelete: '¿Estás seguro de que quieres borrar la línea?', + emptyList: 'Lista vacía', orders: 'Pedidos', order: 'Pedido pendiente', @@ -123,6 +133,5 @@ export default { save: 'Guardar', cancel: 'Cancelar', of: 'de', - emptyList: 'Lista vacía', modify: 'Modificar' }; diff --git a/src/i18n/fr-FR/index.js b/src/i18n/fr-FR/index.js index bcb933d2..7bb5cd13 100644 --- a/src/i18n/fr-FR/index.js +++ b/src/i18n/fr-FR/index.js @@ -40,25 +40,35 @@ export default { ] }, of: 'de', - // Menu - home: 'Accueil', - catalog: 'Catalogue', - pendingOrders: 'Commandes en attente', - confirmedOrders: 'Commandes confirmées', - invoices: 'Factures', - agencyPackages: 'Liste par agence', - accountConfig: 'Configuration', - addressesList: 'Adresses', - addressDetails: 'Configuration', - checkout: "Définissez l'ordre", - controlPanel: 'Panneau de configuration', - adminConnections: 'Connexions', - adminItems: 'Articles', - adminVisits: 'Visites', - adminUsers: 'Gestion des utilisateurs', - adminPhotos: 'Images', - adminNews: 'Gestion des nouvelles', - adminNewsDetails: 'Ajouter ou editer nouvelles', + + // Sections titles + Home: 'Accueil', + Orders: 'Commandes', + Ticket: 'Détail de la commande', + 'Pending orders': 'Commandes en attente', + 'Last orders': 'Commandes confirmées', + Invoices: 'Factures', + Basket: 'Panier', + Catalog: 'Catalogue', + Administration: 'Administration', + 'Control panel': 'Panneau de configuration', + Users: 'Utilisateurs', + Connections: 'Connexions', + Visits: 'Visites', + News: 'Nouvelles', + Photos: 'Images', + Images: 'Images', + Items: 'Articles', + Agencies: 'Agences', + Reports: 'Rapports', + Configuration: 'Configuration', + Shelves: 'Étagères', + Account: 'Compte', + Addresses: 'Adresses', + Confirm: 'Confirmer', + Checkout: 'Configurer la commande', + 'Address details': 'Configuration', + 'Admin news details': 'Ajouter ou éditer une nouvelle', // orderLoadedIntoBasket: 'Commande chargée dans le panier!', loadAnOrder: @@ -71,7 +81,7 @@ export default { noData: 'Aucune donnée', confirm: 'Confirmer', delete: 'Effacer', - reallyDelete: 'Voulez-vous vraiment supprimer la ligne?', emptyList: 'Vider la liste', - modify: 'Modifier' + modify: 'Modifier', + confirmDelete: 'Voulez-vous vraiment supprimer la ligne?' }; diff --git a/src/i18n/pt-PT/index.js b/src/i18n/pt-PT/index.js index 6c1ce25c..3bad5d4e 100644 --- a/src/i18n/pt-PT/index.js +++ b/src/i18n/pt-PT/index.js @@ -40,26 +40,34 @@ export default { ] }, of: 'de', - - // Menu - home: 'Principio', - catalog: 'Catálogo', - pendingOrders: 'Pedidos pendentes', - confirmedOrders: 'Pedidos confirmados', - invoices: 'Facturas', - agencyPackages: 'Bultos por agencia', - accountConfig: 'Configuração', - addressesList: 'Moradas', - addressDetails: 'Configuração', - checkout: 'Configurar encomenda', - controlPanel: 'Painel de controle', - adminConnections: 'Conexões', - adminItems: 'Artigos', - adminVisits: 'Visitas', - adminUsers: 'Gestão de usuários', - adminPhotos: 'Imagens', - adminNews: 'Gestão de notícias', - adminNewsDetails: 'Ajouter ou editer nouvelles', + // Sections titles + Home: 'Início', + Orders: 'Pedidos', + Ticket: 'Detalhe do pedido', + 'Pending orders': 'Pedidos pendentes', + 'Last orders': 'Pedidos confirmados', + Invoices: 'Faturas', + Basket: 'Carrinho', + Catalog: 'Catálogo', + Administration: 'Administração', + 'Control panel': 'Painel de controle', + Users: 'Usuários', + Connections: 'Conexões', + Visits: 'Visitas', + News: 'Notícias', + Photos: 'Imagens', + Images: 'Imagens', + Items: 'Artigos', + Agencies: 'Agências', + Reports: 'Informes', + Configuration: 'Configuração', + Shelves: 'Estantes', + Account: 'Conta', + Addresses: 'Moradas', + Confirm: 'Confirme', + Checkout: 'Configurar encomenda', + 'Address details': 'Configuração', + 'Admin news details': 'Adicionar ou editar notícia', // orderLoadedIntoBasket: 'Pedido carregado na cesta!', loadAnOrder: 'Carregue um pedido pendente no carrinho ou inicie um novo', @@ -71,7 +79,7 @@ export default { noData: 'Sem dados', confirm: 'Confirme', delete: 'Eliminar', - reallyDelete: 'Tens certeza que queres eliminar esta linha?', emptyList: 'Lista vazia', - modify: 'Modificar' + modify: 'Modificar', + confirmDelete: 'Tens certeza que queres eliminar esta linha?' }; diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 67a94b45..7117c32f 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -95,12 +95,12 @@ const logoutSupplantedUser = async () => { - {{ item.description }} + {{ $t(item.description) }} @@ -112,7 +112,7 @@ const logoutSupplantedUser = async () => { > - {{ subitem.description }} + {{ $t(subitem.description) }} diff --git a/src/pages/Ecomerce/BasketView.vue b/src/pages/Ecomerce/BasketView.vue index 8561e883..b80e2e5a 100644 --- a/src/pages/Ecomerce/BasketView.vue +++ b/src/pages/Ecomerce/BasketView.vue @@ -1,5 +1,5 @@ diff --git a/src/router/index.js b/src/router/index.js index cb8a7ea0..340fc410 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -22,8 +22,8 @@ export default route(function (/* { store, ssrContext } */) { const createHistory = process.env.SERVER ? createMemoryHistory : process.env.VUE_ROUTER_MODE === 'history' - ? createWebHistory - : createWebHashHistory; + ? createWebHistory + : createWebHashHistory; const Router = createRouter({ scrollBehavior: () => ({ left: 0, top: 0 }), @@ -41,7 +41,7 @@ export default route(function (/* { store, ssrContext } */) { if (from.name === to.name) return; const app = useAppStore(); app.$patch({ - title: i18n.global.t(to.name || 'home'), + title: i18n.global.t(to.meta.title || 'home'), subtitle: null, useRightDrawer: false, rightDrawerOpen: true diff --git a/src/router/routes.js b/src/router/routes.js index a61776cf..efa8fbab 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -32,106 +32,169 @@ const routes = [ { name: 'home', path: '/cms/home', + meta: { + title: 'Home' + }, component: () => import('src/pages/Cms/HomeView.vue') }, { name: 'confirmedOrders', path: '/ecomerce/orders', + meta: { + title: 'Last orders' + }, component: () => import('pages/Ecomerce/OrdersView.vue') }, { name: 'ticket', path: '/ecomerce/ticket/:id', + meta: { + title: 'Ticket' + }, component: () => import('pages/Ecomerce/TicketView.vue') }, { name: 'invoices', path: '/ecomerce/invoices', + meta: { + title: 'Invoices' + }, component: () => import('pages/Ecomerce/InvoicesView.vue') }, { name: 'pendingOrders', path: '/ecomerce/pending', + meta: { + title: 'Pending orders' + }, component: () => import('pages/Ecomerce/PendingOrders.vue') }, { name: 'catalog', path: '/ecomerce/catalog/:category?/:type?', + meta: { + title: 'Catalog' + }, component: () => import('pages/Ecomerce/Catalog.vue') }, { name: 'basket', path: '/ecomerce/basket/:id?', + meta: { + title: 'Basket' + }, component: () => import('pages/Ecomerce/BasketView.vue') }, { name: 'confirm', path: '/ecomerce/confirm/:id?', + meta: { + title: 'Confirm' + }, component: () => import('pages/Ecomerce/ConfirmView.vue') }, { name: 'checkout', path: '/ecomerce/checkout/:id?', + meta: { + title: 'Checkout' + }, component: () => import('pages/Ecomerce/CheckoutView.vue') }, { name: 'agencyPackages', path: '/agencies/packages', + meta: { + title: 'Agencies' + }, component: () => import('src/pages/Agencies/PackagesView.vue') }, { name: 'accountConfig', path: '/account/conf', + meta: { + title: 'Account' + }, component: () => import('pages/Account/AccountConfig.vue') }, { name: 'addressesList', path: '/account/address-list', + meta: { + title: 'Addresses' + }, component: () => import('pages/Account/AddressList.vue') }, { name: 'addressDetails', path: '/account/address/:id?', + meta: { + title: 'Address details' + }, component: () => import('pages/Account/AddressDetails.vue') }, { name: 'controlPanel', path: 'admin/links', + meta: { + title: 'Control panel' + }, component: () => import('pages/Admin/LinksView.vue') }, { name: 'adminUsers', path: 'admin/users', + meta: { + title: 'Users' + }, component: () => import('pages/Admin/UsersView.vue') }, { name: 'adminConnections', path: 'admin/connections', + meta: { + title: 'Connections' + }, component: () => import('pages/Admin/ConnectionsView.vue') }, { name: 'adminVisits', path: 'admin/visits', + meta: { + title: 'Visits' + }, component: () => import('pages/Admin/VisitsView.vue') }, { name: 'adminNews', path: 'news/news', + meta: { + title: 'News' + }, component: () => import('pages/Admin/NewsView.vue') }, { name: 'adminNewsDetails', path: 'news/new/:id?', + meta: { + title: 'Admin news details' + }, component: () => import('pages/Admin/NewsDetails.vue') }, { name: 'adminPhotos', path: 'admin/photos', + meta: { + title: 'Photos' + }, component: () => import('pages/Admin/PhotosView.vue') }, { name: 'adminItems', path: 'admin/items', + meta: { + title: 'Items' + }, component: () => import('pages/Admin/ItemsView.vue') } ] diff --git a/src/stores/app.js b/src/stores/app.js index 2a3d90fe..184fbb71 100644 --- a/src/stores/app.js +++ b/src/stores/app.js @@ -5,6 +5,7 @@ import { i18n } from 'src/boot/i18n'; import { useQuasar } from 'quasar'; const { notify } = useNotify(); +const storageOrderName = 'hederaBasket'; export const useAppStore = defineStore('hedera', { state: () => ({ @@ -72,7 +73,7 @@ export const useAppStore = defineStore('hedera', { }, getBasketOrderId() { - this.basketOrderId = localStorage.getItem('hederaBasket'); + this.basketOrderId = localStorage.getItem(storageOrderName); }, async checkOrder(orderId) { @@ -87,7 +88,7 @@ export const useAppStore = defineStore('hedera', { if (this.basketOrderId) { return await this.checkRedirect(checkoutContinue); } else { - this.redirect(); + await this.redirect(); return false; } }, @@ -97,22 +98,21 @@ export const useAppStore = defineStore('hedera', { await this.checkOrder(this.basketOrderId); return true; } catch (err) { - if (err.exception === 'Vn.Lib.UserError') { - switch (err.code) { - case 'orderConfirmed': - case 'orderNotOwnedByUser': - await this.redirect(); - break; - default: - this.router.push({ - name: 'checkout', - params: { id: this.basketOrderId }, - query: { continue: checkoutContinue } - }); - notify(err.message, 'negative'); - } - return false; - } else throw err; + switch (err.code) { + case 'orderConfirmed': + case 'orderNotOwnedByUser': + this.unloadOrder(); + await this.redirect(); + break; + default: + this.router.push({ + name: 'checkout', + params: { id: this.basketOrderId }, + query: { continue: checkoutContinue } + }); + notify(err.message, 'negative'); + } + return false; } }, @@ -131,13 +131,13 @@ export const useAppStore = defineStore('hedera', { loadIntoBasket(orderId) { if (this.basketOrderId !== orderId) { this.basketOrderId = orderId; - localStorage.setItem('hederaBasket', orderId); + localStorage.setItem(storageOrderName, orderId); notify('orderLoadedIntoBasket', 'positive'); } }, unloadOrder() { - localStorage.removeItem('hederaBasket'); + localStorage.removeItem(storageOrderName); this.basketOrderId = null; } },