From d90a41280308c4f4ec106951523a4475fa865453 Mon Sep 17 00:00:00 2001 From: Guillaume Vincent Date: Thu, 31 Dec 2015 15:32:12 +0100 Subject: [PATCH] add translations --- app/app.js | 20 ++++++++++-- app/components/features.vue | 41 +++++++++++++++++++++++++ app/components/footer.vue | 4 +-- app/components/header.vue | 23 ++++++++++++++ app/components/headlines.vue | 12 ++++++++ app/components/jumbotron.vue | 19 ++++++++++++ app/components/lesspass-features.vue | 42 -------------------------- app/components/password-generator.vue | 32 +++++++++++--------- app/locales/locales.js | 57 +++++++++++++++++++++++++++++++++++ package.json | 6 ++-- static/css/styles.scss | 18 ----------- static/index.html | 32 ++------------------ 12 files changed, 197 insertions(+), 109 deletions(-) create mode 100644 app/components/features.vue create mode 100644 app/components/header.vue create mode 100644 app/components/headlines.vue create mode 100644 app/components/jumbotron.vue delete mode 100644 app/components/lesspass-features.vue create mode 100644 app/locales/locales.js diff --git a/app/app.js b/app/app.js index 8e95cbd..c4a7a17 100644 --- a/app/app.js +++ b/app/app.js @@ -1,14 +1,30 @@ import Vue from 'vue'; +import i18n from 'vue-i18n'; +import Header from './components/header.vue'; +import Headlines from './components/headlines.vue'; +import Jumbotron from './components/jumbotron.vue'; import PasswordGenerator from './components/password-generator.vue'; import BootstrapHr from './components/bootstrap-hr.vue'; -import LesspassFeatures from './components/lesspass-features.vue'; +import Features from './components/features.vue'; import Footer from './components/footer.vue'; +import locales from './locales/locales'; + +var browserLanguage = (navigator.language || navigator.browserLanguage).split('-')[0]; +var lang = browserLanguage in locales ? browserLanguage : 'en'; + +Vue.use(i18n, { + lang: lang, + locales: locales +}); new Vue({ el: 'body', components: { + lesspassHeader: Header, + lesspassHeadlines: Headlines, + lesspassJumbotron: Jumbotron, passwordGenerator: PasswordGenerator, - lesspassFeatures: LesspassFeatures, + lesspassFeatures: Features, lesspassFooter: Footer, bootstrapHr: BootstrapHr } diff --git a/app/components/features.vue b/app/components/features.vue new file mode 100644 index 0000000..ef03bec --- /dev/null +++ b/app/components/features.vue @@ -0,0 +1,41 @@ + + \ No newline at end of file diff --git a/app/components/footer.vue b/app/components/footer.vue index 7d12a14..1d4c5d0 100644 --- a/app/components/footer.vue +++ b/app/components/footer.vue @@ -9,8 +9,8 @@

LessPass - - réalisé par Guillaume Vincent - - code source + - {{ $t('built_by') }} Guillaume Vincent + - {{ $t('source_code') }}

diff --git a/app/components/header.vue b/app/components/header.vue new file mode 100644 index 0000000..d3dcef2 --- /dev/null +++ b/app/components/header.vue @@ -0,0 +1,23 @@ + + \ No newline at end of file diff --git a/app/components/headlines.vue b/app/components/headlines.vue new file mode 100644 index 0000000..5199b66 --- /dev/null +++ b/app/components/headlines.vue @@ -0,0 +1,12 @@ + + \ No newline at end of file diff --git a/app/components/jumbotron.vue b/app/components/jumbotron.vue new file mode 100644 index 0000000..2b6e8b1 --- /dev/null +++ b/app/components/jumbotron.vue @@ -0,0 +1,19 @@ + + \ No newline at end of file diff --git a/app/components/lesspass-features.vue b/app/components/lesspass-features.vue deleted file mode 100644 index 29556e7..0000000 --- a/app/components/lesspass-features.vue +++ /dev/null @@ -1,42 +0,0 @@ - - \ No newline at end of file diff --git a/app/components/password-generator.vue b/app/components/password-generator.vue index 3844628..86fe41c 100644 --- a/app/components/password-generator.vue +++ b/app/components/password-generator.vue @@ -5,34 +5,38 @@ border: 1px solid #434857; } + "Email":"Email", + "Password":"Password", + "Site": "Web site", + "Copy": "Copy"