From 9113a265ba23892b87815f0dcacf31cef2694c4d Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sun, 6 Sep 2020 13:32:32 -0400 Subject: i18n Support; French support --- components/Footer.vue | 2 +- components/Navbar.vue | 61 +++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 46 insertions(+), 17 deletions(-) (limited to 'components') diff --git a/components/Footer.vue b/components/Footer.vue index 8c6d144..762158f 100644 --- a/components/Footer.vue +++ b/components/Footer.vue @@ -2,7 +2,7 @@
-

© Copyright 2018-{{ new Date().getFullYear() }} Andrew Lee. All rights reserved.

+

{{ $t('FooterCopyright') }}

diff --git a/components/Navbar.vue b/components/Navbar.vue index f52e902..a066aaf 100644 --- a/components/Navbar.vue +++ b/components/Navbar.vue @@ -10,9 +10,18 @@ - {{ item.title }} + {{ $t('HomeText') }} + {{ $t('BlogText') }} + {{ $t('ProjectsText') }} + {{ $t('VideosText') }} + + + {{ locale.name }} + + Hey there! This is just a temporary message saying that the french option is in beta! If you see some problems with my french, be sure to make a pull request or point it out on my issues page! + @@ -23,14 +32,32 @@ - - - mdi-{{ item.icon }} - - - {{ item.title }} - - + + + {{ $t('HomeText') }} + + + + + {{ $t('BlogText') }} + + + + + {{ $t('ProjectsText') }} + + + + + {{ $t('VideosText') }} + + + + + + {{ locale.name }} + + @@ -41,17 +68,19 @@ export default { name: 'Navbar', data () { return { - drawer: false, - items: [ - { title: 'Home', link: '/', icon: 'home' }, - { title: 'Blog', link: '/blog', icon: 'blog' }, - { title: 'Projects', link: '/projects', icon: 'projects' }, - { title: 'Videos', link: '/videos', icon: 'videos' } - ] + drawer: false + } + }, + computed: { + availableLocales () { + return this.$i18n.locales.filter(i => i.code !== this.$i18n.locale) } } } -- cgit v1.2.3