From 90d13d31f5faca5b081c7198d475b5a1aa4a56f8 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 18 Oct 2022 12:35:50 +0200 Subject: [PATCH] feat: create language picker --- src/App.vue | 7 --- src/assets/lang/en-US.svg | 2 + src/assets/lang/fr-FR.svg | 2 + src/components/Footer.vue | 7 +-- src/components/Home.vue | 17 ++++++- src/components/LangPicker.vue | 90 +++++++++++++++++++++++++++++++++++ 6 files changed, 114 insertions(+), 11 deletions(-) create mode 100644 src/assets/lang/en-US.svg create mode 100644 src/assets/lang/fr-FR.svg create mode 100644 src/components/LangPicker.vue diff --git a/src/App.vue b/src/App.vue index 140358d..198891d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -52,13 +52,6 @@ export default class App extends Vue { return; } picker.select(tID.Vue, false); - - // change app language - if( navigator.language.indexOf('fr') > -1 ){ - this.$i18n.locale = Locales.FR; - } else { - this.$i18n.locale = Locales.EN; - } } } diff --git a/src/assets/lang/en-US.svg b/src/assets/lang/en-US.svg new file mode 100644 index 0000000..164cd39 --- /dev/null +++ b/src/assets/lang/en-US.svg @@ -0,0 +1,2 @@ + + diff --git a/src/assets/lang/fr-FR.svg b/src/assets/lang/fr-FR.svg new file mode 100644 index 0000000..64428e2 --- /dev/null +++ b/src/assets/lang/fr-FR.svg @@ -0,0 +1,2 @@ + + diff --git a/src/components/Footer.vue b/src/components/Footer.vue index 55b751d..539208e 100644 --- a/src/components/Footer.vue +++ b/src/components/Footer.vue @@ -13,9 +13,10 @@
- (+33) 06 69 05 19 10 - xdrm.dev@gmail.com - Montauban, 82000 + xdrm.io + (+33) 06 69 05 19 10 + xdrm.dev@gmail.com + Montauban, 82000
diff --git a/src/components/Home.vue b/src/components/Home.vue index 2e13180..01201e7 100644 --- a/src/components/Home.vue +++ b/src/components/Home.vue @@ -7,6 +7,7 @@ Montauban, 82000 + @@ -40,9 +41,11 @@ import { Component, Vue } from 'vue-property-decorator'; import { go } from '@/service/scroller'; import { TypeWriter } from '@/service/typewriter'; +import LangPicker from './LangPicker.vue'; +LangPicker @Component({ - components: {}, + components: { LangPicker }, }) export default class Home extends Vue { protected scrollNext() { @@ -147,8 +150,20 @@ export default class Home extends Vue { color: #9ea6b3; font-size: 1.2em; font-weight: 400; + } + .lang-picker { + display: block; + position: absolute; + top: 0; + right: 0; + + margin-top: 1em; + margin-right: 1em; + + font-size: 1.2em; + } .logo { grid-column: 2; diff --git a/src/components/LangPicker.vue b/src/components/LangPicker.vue new file mode 100644 index 0000000..80dec83 --- /dev/null +++ b/src/components/LangPicker.vue @@ -0,0 +1,90 @@ + + + + + +