From dbcf0bd051066f124ffe6697b937ef85035a60c8 Mon Sep 17 00:00:00 2001 From: lesion Date: Fri, 25 Nov 2022 09:47:46 +0100 Subject: [PATCH] translate about / home button --- components/Footer.vue | 4 ++-- components/admin/Theme.vue | 9 +++++---- locales/en.json | 3 ++- locales/it.json | 4 +++- server/api/controller/settings.js | 4 ++-- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/components/Footer.vue b/components/Footer.vue index bac94613..31f22f69 100644 --- a/components/Footer.vue +++ b/components/Footer.vue @@ -46,9 +46,9 @@ export default { if (!this.settings || !this.settings.footerLinks) return [] return this.settings.footerLinks.map(link => { if (/^https?:\/\//.test(link.href)) { - return { href: link.href, label: link.label } + return { href: link.href, label: link.label.startsWith('common.') ? this.$t(link.label) : link.label } } else { - return { to: link.href, label: link.label } + return { to: link.href, label: link.label.startsWith('common.') ? this.$t(link.label) : link.label } } }) } diff --git a/components/admin/Theme.vue b/components/admin/Theme.vue index 42c1877b..6b65ffd4 100644 --- a/components/admin/Theme.vue +++ b/components/admin/Theme.vue @@ -81,8 +81,8 @@ v-container :label="$t('common.url')") v-card-actions v-spacer - v-btn(link @click='linkModal=false' color='error') {{$t('common.cancel')}} - v-btn(link @click='addFooterLink' color='primary' :disabled='!valid') {{$t('common.add')}} + v-btn(outlined @click='linkModal=false' color='error') {{$t('common.cancel')}} + v-btn(outlined @click='addFooterLink' color='primary' :disabled='!valid') {{$t('common.add')}} v-card-title {{$t('admin.footer_links')}} v-card-text @@ -166,8 +166,9 @@ export default { this.setSetting({ key: 'footerLinks', value: [ - { href: '/about', label: 'about' }, - { href: '/', label: 'home' }] + { href: '/', label: 'common.home' }, + { href: '/about', label: 'common.about' } + ] }) }, forceLogoReload () { diff --git a/locales/en.json b/locales/en.json index 89993e54..854f7270 100644 --- a/locales/en.json +++ b/locales/en.json @@ -93,7 +93,8 @@ "help_translate": "Help Translate", "show_map": "Show map", "calendar": "Calendar", - "home": "Home" + "home": "Home", + "about": "About" }, "login": { "description": "By logging in you can publish new events.", diff --git a/locales/it.json b/locales/it.json index fef80b9b..caea6b07 100644 --- a/locales/it.json +++ b/locales/it.json @@ -93,7 +93,9 @@ "latitude": "Latitudine", "longitude": "Longitudine", "getting_there": "Come arrivare", - "calendar": "Calendario" + "calendar": "Calendario", + "home": "Home", + "about": "Cos'รจ" }, "login": { "description": "Entrando puoi pubblicare nuovi eventi.", diff --git a/server/api/controller/settings.js b/server/api/controller/settings.js index 100c583a..eda1c8e7 100644 --- a/server/api/controller/settings.js +++ b/server/api/controller/settings.js @@ -40,8 +40,8 @@ const defaultSettings = { hide_thumbs: false, hide_calendar: false, footerLinks: [ - { href: '/', label: 'home' }, - { href: '/about', label: 'about' } + { href: '/', label: 'common.home' }, + { href: '/about', label: 'common.about' } ], plugins: [], admin_email: config.admin_email || '',