0
1
Fork 0

Add different translations for header titles and menu titles

This commit is contained in:
William Buezas 2024-09-29 20:30:16 -03:00
parent 477c42b964
commit 2eb0963829
7 changed files with 278 additions and 144 deletions

View File

@ -51,6 +51,7 @@ export default {
of: 'de',
// Sections titles
titles: {
Home: 'Inici',
Orders: 'Comandes',
Ticket: `Detall de l'encarrec`,
@ -78,7 +79,31 @@ export default {
Checkout: `Configurar l'encarrec`,
'Address details': 'Configuració',
'Admin news details': `Afegir o editar notícia`,
'Access log': 'Registre daccés',
'Access log': 'Registre daccés'
},
menuTitles: {
Home: 'Inici',
Orders: 'Comandes',
Basket: 'Cistella',
Catalog: 'Catàleg',
Administration: 'Administració',
Agencies: 'Agències',
Reports: 'Informes',
Shelves: 'Prestatgeries',
Configuration: 'Configuració',
'Pending orders': 'Pendents',
'Last orders': 'Confirmades',
Invoices: 'Factures',
'Control panel': 'Panell de control',
Users: 'Usuaris',
Connections: 'Connexions',
Visits: 'Visites',
News: 'Gestió de notícies',
Photos: 'Imatges',
Items: 'Articles',
Account: 'Compte',
Addresses: 'Adreces'
},
//
orderLoadedIntoBasket: 'Comanda carregada a la cistella!',
loadAnOrder:

View File

@ -63,6 +63,7 @@ export default {
},
// Sections titles
titles: {
Home: 'Home',
Orders: 'Orders',
Ticket: 'Detalle del pedido',
@ -90,7 +91,32 @@ export default {
Checkout: 'Configure order',
'Address details': 'Configuration',
'Admin news details': 'Add or edit new',
'Access log': 'Access log',
'Access log': 'Access log'
},
menuTitles: {
Home: 'Home',
Orders: 'Orders',
Basket: 'Basket',
Catalog: 'Catalog',
Administration: 'Administration',
Agencies: 'Agencies',
Reports: 'Reports',
Shelves: 'Shelves',
Configuration: 'Configuration',
'Pending orders': 'Pending',
'Last orders': 'Confirmed',
Invoices: 'Invoices',
'Control panel': 'Control panel',
Users: 'Users',
Connections: 'Connections',
Visits: 'Visits',
News: 'News',
Photos: 'Images',
Items: 'Items',
Account: 'Account',
Addresses: 'Addresses'
},
//
orderLoadedIntoBasket: 'Order loaded into basket!',
loadAnOrder: 'Please load a pending order to the cart or start a new one',

View File

@ -60,6 +60,7 @@ export default {
},
// Sections titles
titles: {
Home: 'Inicio',
Orders: 'Pedidos',
Ticket: 'Pedido',
@ -87,7 +88,32 @@ export default {
Checkout: 'Configurar pedido',
'Address details': 'Configuración',
'Admin news details': 'Añadir o editar noticia',
'Access log': 'Registro de accesos',
'Access log': 'Registro de accesos'
},
menuTitles: {
Home: 'Inicio',
Orders: 'Pedidos',
Basket: 'Cesta',
Catalog: 'Catálogo',
Administration: 'Administración',
Agencies: 'Agencias',
Reports: 'Informes',
Shelves: 'Estanterías',
Configuration: 'Configuración',
'Pending orders': 'Pendientes',
'Last orders': 'Confirmados',
Invoices: 'Facturas',
'Control panel': 'Panel de control',
Users: 'Usuarios',
Connections: 'Conexiones',
Visits: 'Visitas',
News: 'Noticias',
Photos: 'Imágenes',
Items: 'Artículos',
Account: 'Cuenta',
Addresses: 'Direcciones'
},
//
orderLoadedIntoBasket: '¡Pedido cargado en la cesta!',
loadAnOrder:

View File

@ -51,6 +51,7 @@ export default {
of: 'de',
// Sections titles
titles: {
Home: 'Accueil',
Orders: 'Commandes',
Ticket: 'Détail de la commande',
@ -78,7 +79,32 @@ export default {
Checkout: 'Configurer la commande',
'Address details': 'Configuration',
'Admin news details': 'Ajouter ou éditer une nouvelle',
'Access log': "Journal d'accès",
'Access log': "Journal d'accès"
},
menuTitles: {
Home: 'Accueil',
Orders: 'Commandes',
Basket: 'Panier',
Catalog: 'Catalogue',
Administration: 'Administration',
Agencies: 'Agences',
Reports: 'Rapports',
Shelves: 'Étagères',
Configuration: 'Configuration',
'Pending orders': 'En attente',
'Last orders': 'Confirmées',
Invoices: 'Factures',
'Control panel': 'Panneau de configuration',
Users: 'Utilisateurs',
Connections: 'Connexions',
Visits: 'Visites',
News: 'Nouvelles',
Photos: 'Images',
Items: 'Articles',
Account: 'Compte',
Addresses: 'Adresses'
},
//
orderLoadedIntoBasket: 'Commande chargée dans le panier!',
loadAnOrder:

View File

@ -50,6 +50,7 @@ export default {
},
of: 'de',
// Sections titles
titles: {
Home: 'Início',
Orders: 'Pedidos',
Ticket: 'Detalhe do pedido',
@ -77,7 +78,31 @@ export default {
Checkout: 'Configurar encomenda',
'Address details': 'Configuração',
'Admin news details': 'Adicionar ou editar notícia',
'Access log': 'Registo de acessos',
'Access log': 'Registo de acessos'
},
menuTitles: {
Home: 'Início',
Orders: 'Pedidos',
Basket: 'Carrinho',
Catalog: 'Catálogo',
Administration: 'Administração',
Agencies: 'Agências',
Reports: 'Informes',
Shelves: 'Estantes',
Configuration: 'Configuração',
'Pending orders': 'Pendentes',
'Last orders': 'Confirmados',
Invoices: 'Faturas',
'Control panel': 'Painel de controle',
Users: 'Usuários',
Connections: 'Conexões',
Visits: 'Visitas',
News: 'Notícias',
Photos: 'Imagens',
Items: 'Artigos',
Account: 'Conta',
Addresses: 'Moradas'
},
//
orderLoadedIntoBasket: 'Pedido carregado na cesta!',
loadAnOrder: 'Carregue um pedido pendente no carrinho ou inicie um novo',

View File

@ -93,12 +93,14 @@ const logoutSupplantedUser = async () => {
<QList v-for="item in menuEssentialLinks" :key="item.id">
<QItem v-if="!item.childs" :to="`/${item.path}`">
<QItemSection>
<QItemLabel>{{ $t(item.description) }}</QItemLabel>
<QItemLabel>{{
$t(`menuTitles.${item.description}`)
}}</QItemLabel>
</QItemSection>
</QItem>
<QExpansionItem
v-if="item.childs"
:label="$t(item.description)"
:label="$t(`menuTitles.${item.description}`)"
expand-separator
>
<QList>
@ -110,7 +112,9 @@ const logoutSupplantedUser = async () => {
>
<QItemSection>
<QItemLabel>
{{ $t(subitem.description) }}
{{
$t(`menuTitles.${subitem.description}`)
}}
</QItemLabel>
</QItemSection>
</QItem>

View File

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