0
1
Fork 0

Add menu translations

This commit is contained in:
William Buezas 2024-09-07 19:34:22 -03:00
parent 2bff9304e8
commit c41d1430f7
8 changed files with 213 additions and 109 deletions

View File

@ -40,26 +40,35 @@ export default {
] ]
}, },
of: 'de', of: 'de',
// Menu
home: 'Inici', // Sections titles
catalog: 'Catàleg', Home: 'Inici',
pendingOrders: 'Comandes pendents', Orders: 'Comandes',
confirmedOrders: 'Comandes confirmades', Ticket: `Detall de l'encarrec`,
invoices: 'Factures', 'Pending orders': 'Comandes pendents',
agencyPackages: 'Paquets per agència', 'Last orders': 'Comandes confirmades',
accountConfig: 'Configuració', Invoices: 'Factures',
addressesList: 'Adreces', Basket: 'Cistella',
addressDetails: 'Configuració', Catalog: 'Catàleg',
checkout: 'Configurar encàrrec', Administration: 'Administració',
controlPanel: 'Panell de control', 'Control panel': 'Panell de control',
adminConnections: 'Connexions', Users: 'Usuaris',
adminItems: 'Articles', Connections: 'Connexions',
adminVisits: 'Visites', Visits: 'Visites',
adminUsers: "Gestió d'usuaris", News: 'Notícies',
adminPhotos: 'Imatges', Photos: 'Imatges',
adminNews: 'Gestió de noticies', Images: 'Imatges',
adminNewsDetails: 'Afegir o editar notícia', Items: 'Articles',
basket: 'Cistella de la compra', 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!', orderLoadedIntoBasket: 'Comanda carregada a la cistella!',
loadAnOrder: loadAnOrder:

View File

@ -53,26 +53,34 @@ export default {
] ]
}, },
// menu // Sections titles
home: 'Home', Home: 'Home',
catalog: 'Catalog', Orders: 'Orders',
pendingOrders: 'Pending orders', Ticket: 'Detalle del pedido',
confirmedOrders: 'Confirmed orders', 'Pending orders': 'Pending orders',
invoices: 'Invoices', 'Last orders': 'Confirmed orders',
agencyPackages: 'Bundles by agency', Invoices: 'Invoices',
accountConfig: 'Configuration', Basket: 'Basket',
addressesList: 'Addresses', Catalog: 'Catalog',
addressDetails: 'Configuration', Administration: 'Administration',
checkout: 'Configure order', 'Control panel': 'Control panel',
controlPanel: 'Control panel', Users: 'Users',
adminConnections: 'Connections', Connections: 'Connections',
adminItems: 'Items', Visits: 'Visits',
adminVisits: 'Visits', News: 'News',
adminUsers: 'User management', Photos: 'Images',
adminPhotos: 'Images', Images: 'Images',
adminNews: 'News management', Items: 'Items',
adminNewsDetails: 'Add or edit new', Agencies: 'Agencies',
basket: 'Shopping basket', 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!', orderLoadedIntoBasket: 'Order loaded into basket!',
loadAnOrder: 'Please load a pending order to the cart or start a new one', loadAnOrder: 'Please load a pending order to the cart or start a new one',

View File

@ -59,26 +59,34 @@ export default {
] ]
}, },
// Menu // Sections titles
home: 'Inicio', Home: 'Inicio',
catalog: 'Catálogo', Orders: 'Pedidos',
pendingOrders: 'Pedidos pendientes', Ticket: 'Pedido',
confirmedOrders: 'Pedidos confirmados', 'Pending orders': 'Pedidos pendientes',
invoices: 'Facturas', 'Last orders': 'Pedidos confirmados',
agencyPackages: 'Bultos por agencia', Invoices: 'Facturas',
accountConfig: 'Configuración', Basket: 'Cesta',
addressesList: 'Direcciones', Catalog: 'Catálogo',
addressDetails: 'Configuración', Administration: 'Administración',
checkout: 'Configurar pedido', 'Control panel': 'Panel de control',
controlPanel: 'Panel de control', Users: 'Usuarios',
adminConnections: 'Conexiones', Connections: 'Conexiones',
adminItems: 'Artículos', Visits: 'Visitas',
adminVisits: 'Visitas', News: 'Noticias',
adminUsers: 'Gestión de usuarios', Photos: 'Imágenes',
adminPhotos: 'Imágenes', Images: 'Imágenes',
adminNews: 'Gestión de noticias', Items: 'Artículos',
adminNewsDetails: 'Añadir o editar noticia', Agencies: 'Agencias',
basket: 'Cesta de la compra', 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!', orderLoadedIntoBasket: '¡Pedido cargado en la cesta!',
loadAnOrder: loadAnOrder:

View File

@ -40,27 +40,35 @@ export default {
] ]
}, },
of: 'de', of: 'de',
// Menu
home: 'Accueil', // Sections titles
catalog: 'Catalogue', Home: 'Accueil',
pendingOrders: 'Commandes en attente', Orders: 'Commandes',
confirmedOrders: 'Commandes confirmées', Ticket: 'Détail de la commande',
invoices: 'Factures', 'Pending orders': 'Commandes en attente',
agencyPackages: 'Liste par agence', 'Last orders': 'Commandes confirmées',
accountConfig: 'Configuration', Invoices: 'Factures',
addressesList: 'Adresses', Basket: 'Panier',
addressDetails: 'Configuration', Catalog: 'Catalogue',
checkout: "Définissez l'ordre", Administration: 'Administration',
controlPanel: 'Panneau de configuration', 'Control panel': 'Panneau de configuration',
adminConnections: 'Connexions', Users: 'Utilisateurs',
adminItems: 'Articles', Connections: 'Connexions',
adminVisits: 'Visites', Visits: 'Visites',
adminUsers: 'Gestion des utilisateurs', News: 'Nouvelles',
adminPhotos: 'Images', Photos: 'Images',
adminNews: 'Gestion des nouvelles', Images: 'Images',
adminNewsDetails: 'Ajouter ou editer nouvelles', Items: 'Articles',
emptyList: 'Vider la liste', Agencies: 'Agences',
basket: 'Panier', 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!', orderLoadedIntoBasket: 'Commande chargée dans le panier!',
loadAnOrder: loadAnOrder:

View File

@ -40,28 +40,34 @@ export default {
] ]
}, },
of: 'de', of: 'de',
// Sections titles
// Menu Home: 'Início',
home: 'Principio', Orders: 'Pedidos',
catalog: 'Catálogo', Ticket: 'Detalhe do pedido',
pendingOrders: 'Pedidos pendentes', 'Pending orders': 'Pedidos pendentes',
confirmedOrders: 'Pedidos confirmados', 'Last orders': 'Pedidos confirmados',
invoices: 'Facturas', Invoices: 'Faturas',
agencyPackages: 'Bultos por agencia', Basket: 'Carrinho',
accountConfig: 'Configuração', Catalog: 'Catálogo',
addressesList: 'Moradas', Administration: 'Administração',
addressDetails: 'Configuração', 'Control panel': 'Painel de controle',
checkout: 'Configurar encomenda', Users: 'Usuários',
controlPanel: 'Painel de controle', Connections: 'Conexões',
adminConnections: 'Conexões', Visits: 'Visitas',
adminItems: 'Artigos', News: 'Notícias',
adminVisits: 'Visitas', Photos: 'Imagens',
adminUsers: 'Gestão de usuários', Images: 'Imagens',
adminPhotos: 'Imagens', Items: 'Artigos',
adminNews: 'Gestão de notícias', Agencies: 'Agências',
adminNewsDetails: 'Ajouter ou editer nouvelles', Reports: 'Informes',
emptyList: 'Lista vazia', Configuration: 'Configuração',
basket: 'Cesta da compra', 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!', orderLoadedIntoBasket: 'Pedido carregado na cesta!',
loadAnOrder: 'Carregue um pedido pendente no carrinho ou inicie um novo', loadAnOrder: 'Carregue um pedido pendente no carrinho ou inicie um novo',

View File

@ -1,5 +1,6 @@
<script setup> <script setup>
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
@ -7,6 +8,7 @@ import { useRouter } from 'vue-router';
import { useUserStore } from 'stores/user'; import { useUserStore } from 'stores/user';
import { useAppStore } from 'stores/app'; import { useAppStore } from 'stores/app';
const { t } = useI18n();
const router = useRouter(); const router = useRouter();
const userStore = useUserStore(); const userStore = useUserStore();
const appStore = useAppStore(); const appStore = useAppStore();
@ -95,12 +97,12 @@ const logoutSupplantedUser = async () => {
<QList v-for="item in menuEssentialLinks" :key="item.id"> <QList v-for="item in menuEssentialLinks" :key="item.id">
<QItem v-if="!item.childs" :to="`/${item.path}`"> <QItem v-if="!item.childs" :to="`/${item.path}`">
<QItemSection> <QItemSection>
<QItemLabel>{{ item.description }}</QItemLabel> <QItemLabel>{{ t(item.description) }}</QItemLabel>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QExpansionItem <QExpansionItem
v-if="item.childs" v-if="item.childs"
:label="item.description" :label="t(item.description)"
expand-separator expand-separator
> >
<QList> <QList>
@ -112,7 +114,7 @@ const logoutSupplantedUser = async () => {
> >
<QItemSection> <QItemSection>
<QItemLabel> <QItemLabel>
{{ subitem.description }} {{ t(subitem.description) }}
</QItemLabel> </QItemLabel>
</QItemSection> </QItemSection>
</QItem> </QItem>

View File

@ -41,7 +41,7 @@ export default route(function (/* { store, ssrContext } */) {
if (from.name === to.name) return; if (from.name === to.name) return;
const app = useAppStore(); const app = useAppStore();
app.$patch({ app.$patch({
title: i18n.global.t(to.name || 'home'), title: i18n.global.t(to.meta.title || 'home'),
subtitle: null, subtitle: null,
useRightDrawer: false, useRightDrawer: false,
rightDrawerOpen: true rightDrawerOpen: true

View File

@ -32,106 +32,169 @@ const routes = [
{ {
name: 'home', name: 'home',
path: '/cms/home', path: '/cms/home',
meta: {
title: 'Home'
},
component: () => import('src/pages/Cms/HomeView.vue') component: () => import('src/pages/Cms/HomeView.vue')
}, },
{ {
name: 'confirmedOrders', name: 'confirmedOrders',
path: '/ecomerce/orders', path: '/ecomerce/orders',
meta: {
title: 'Last orders'
},
component: () => import('pages/Ecomerce/OrdersView.vue') component: () => import('pages/Ecomerce/OrdersView.vue')
}, },
{ {
name: 'ticket', name: 'ticket',
path: '/ecomerce/ticket/:id', path: '/ecomerce/ticket/:id',
meta: {
title: 'Ticket'
},
component: () => import('pages/Ecomerce/TicketView.vue') component: () => import('pages/Ecomerce/TicketView.vue')
}, },
{ {
name: 'invoices', name: 'invoices',
path: '/ecomerce/invoices', path: '/ecomerce/invoices',
meta: {
title: 'Invoices'
},
component: () => import('pages/Ecomerce/InvoicesView.vue') component: () => import('pages/Ecomerce/InvoicesView.vue')
}, },
{ {
name: 'pendingOrders', name: 'pendingOrders',
path: '/ecomerce/pending', path: '/ecomerce/pending',
meta: {
title: 'Pending orders'
},
component: () => import('pages/Ecomerce/PendingOrders.vue') component: () => import('pages/Ecomerce/PendingOrders.vue')
}, },
{ {
name: 'catalog', name: 'catalog',
path: '/ecomerce/catalog/:category?/:type?', path: '/ecomerce/catalog/:category?/:type?',
meta: {
title: 'Catalog'
},
component: () => import('pages/Ecomerce/Catalog.vue') component: () => import('pages/Ecomerce/Catalog.vue')
}, },
{ {
name: 'basket', name: 'basket',
path: '/ecomerce/basket/:id?', path: '/ecomerce/basket/:id?',
meta: {
title: 'Basket'
},
component: () => import('pages/Ecomerce/BasketView.vue') component: () => import('pages/Ecomerce/BasketView.vue')
}, },
{ {
name: 'confirm', name: 'confirm',
path: '/ecomerce/confirm/:id?', path: '/ecomerce/confirm/:id?',
meta: {
title: 'Confirm'
},
component: () => import('pages/Ecomerce/ConfirmView.vue') component: () => import('pages/Ecomerce/ConfirmView.vue')
}, },
{ {
name: 'checkout', name: 'checkout',
path: '/ecomerce/checkout/:id?', path: '/ecomerce/checkout/:id?',
meta: {
title: 'Checkout'
},
component: () => import('pages/Ecomerce/CheckoutView.vue') component: () => import('pages/Ecomerce/CheckoutView.vue')
}, },
{ {
name: 'agencyPackages', name: 'agencyPackages',
path: '/agencies/packages', path: '/agencies/packages',
meta: {
title: 'Agencies'
},
component: () => import('src/pages/Agencies/PackagesView.vue') component: () => import('src/pages/Agencies/PackagesView.vue')
}, },
{ {
name: 'accountConfig', name: 'accountConfig',
path: '/account/conf', path: '/account/conf',
meta: {
title: 'Account'
},
component: () => import('pages/Account/AccountConfig.vue') component: () => import('pages/Account/AccountConfig.vue')
}, },
{ {
name: 'addressesList', name: 'addressesList',
path: '/account/address-list', path: '/account/address-list',
meta: {
title: 'Addresses'
},
component: () => import('pages/Account/AddressList.vue') component: () => import('pages/Account/AddressList.vue')
}, },
{ {
name: 'addressDetails', name: 'addressDetails',
path: '/account/address/:id?', path: '/account/address/:id?',
meta: {
title: 'Address details'
},
component: () => import('pages/Account/AddressDetails.vue') component: () => import('pages/Account/AddressDetails.vue')
}, },
{ {
name: 'controlPanel', name: 'controlPanel',
path: 'admin/links', path: 'admin/links',
meta: {
title: 'Control panel'
},
component: () => import('pages/Admin/LinksView.vue') component: () => import('pages/Admin/LinksView.vue')
}, },
{ {
name: 'adminUsers', name: 'adminUsers',
path: 'admin/users', path: 'admin/users',
meta: {
title: 'Users'
},
component: () => import('pages/Admin/UsersView.vue') component: () => import('pages/Admin/UsersView.vue')
}, },
{ {
name: 'adminConnections', name: 'adminConnections',
path: 'admin/connections', path: 'admin/connections',
meta: {
title: 'Connections'
},
component: () => import('pages/Admin/ConnectionsView.vue') component: () => import('pages/Admin/ConnectionsView.vue')
}, },
{ {
name: 'adminVisits', name: 'adminVisits',
path: 'admin/visits', path: 'admin/visits',
meta: {
title: 'Visits'
},
component: () => import('pages/Admin/VisitsView.vue') component: () => import('pages/Admin/VisitsView.vue')
}, },
{ {
name: 'adminNews', name: 'adminNews',
path: 'news/news', path: 'news/news',
meta: {
title: 'News'
},
component: () => import('pages/Admin/NewsView.vue') component: () => import('pages/Admin/NewsView.vue')
}, },
{ {
name: 'adminNewsDetails', name: 'adminNewsDetails',
path: 'news/new/:id?', path: 'news/new/:id?',
meta: {
title: 'Admin news details'
},
component: () => import('pages/Admin/NewsDetails.vue') component: () => import('pages/Admin/NewsDetails.vue')
}, },
{ {
name: 'adminPhotos', name: 'adminPhotos',
path: 'admin/photos', path: 'admin/photos',
meta: {
title: 'Photos'
},
component: () => import('pages/Admin/PhotosView.vue') component: () => import('pages/Admin/PhotosView.vue')
}, },
{ {
name: 'adminItems', name: 'adminItems',
path: 'admin/items', path: 'admin/items',
meta: {
title: 'Items'
},
component: () => import('pages/Admin/ItemsView.vue') component: () => import('pages/Admin/ItemsView.vue')
} }
] ]