From 98175ab3261ef4eac32b20c2b562895f7a179bb2 Mon Sep 17 00:00:00 2001 From: hunterlong Date: Mon, 1 Jun 2020 23:56:19 -0700 Subject: [PATCH 1/3] i18n implementation for frontend, oauth url fixes, added language into Core, --- .gitattributes | 2 +- LICENSE | 4 +- frontend/config/webpack.config.common.js | 7 ++- frontend/package.json | 2 + frontend/src/App.vue | 4 +- .../components/Dashboard/DashboardUsers.vue | 2 + .../components/Index/GroupServiceFailures.vue | 15 ++----- .../src/components/Service/ServiceBlock.vue | 12 ----- frontend/src/forms/CoreSettings.vue | 12 +++++ frontend/src/forms/OAuth.vue | 6 +-- frontend/src/forms/Service.vue | 14 ++++-- frontend/src/forms/Setup.vue | 44 ++++++++++++------- frontend/src/forms/User.vue | 5 +-- frontend/src/languages/english.js | 33 ++++++++++++++ frontend/src/languages/french.js | 19 ++++++++ frontend/src/languages/german.js | 19 ++++++++ frontend/src/languages/index.js | 15 +++++++ frontend/src/languages/russian.js | 19 ++++++++ frontend/src/languages/spanish.js | 19 ++++++++ frontend/src/main.js | 19 +++++--- frontend/src/mixin.js | 31 ++++++++----- frontend/yarn.lock | 20 +++++++++ handlers/oauth.go | 4 -- handlers/setup.go | 3 ++ types/configs/struct.go | 1 + types/core/database.go | 1 + types/core/struct.go | 1 + utils/configs.go | 1 + 28 files changed, 259 insertions(+), 75 deletions(-) create mode 100644 frontend/src/languages/english.js create mode 100644 frontend/src/languages/french.js create mode 100644 frontend/src/languages/german.js create mode 100644 frontend/src/languages/index.js create mode 100644 frontend/src/languages/russian.js create mode 100644 frontend/src/languages/spanish.js diff --git a/.gitattributes b/.gitattributes index 37e6bb8e..cfa572fe 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -*.gohtml linguist-language=golang +*.gohtml linguist-index=golang *.js linguist-detectable=false *.yml linguist-detectable=false *.json linguist-detectable=false diff --git a/LICENSE b/LICENSE index 1125e62e..1c506dda 100644 --- a/LICENSE +++ b/LICENSE @@ -117,8 +117,8 @@ form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. +interfaces specified for a particular programming index, one that +is widely used among developers working in that index. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of diff --git a/frontend/config/webpack.config.common.js b/frontend/config/webpack.config.common.js index 5a85a3f7..ebc5c82a 100644 --- a/frontend/config/webpack.config.common.js +++ b/frontend/config/webpack.config.common.js @@ -22,7 +22,12 @@ const webpackConfig = { { test: /\.vue$/, loader: 'vue-loader', - include: [ helpers.root('src') ] + include: [ helpers.root('src') ], + options: { + loaders: { + i18n: '@kazupon/vue-i18n-loader' + } + } }, { test: /\.js$/, diff --git a/frontend/package.json b/frontend/package.json index 6b366b32..b672688d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -36,6 +36,7 @@ "vue-cookies": "^1.7.0", "vue-flatpickr-component": "^8.1.5", "vue-github-button": "^1.1.2", + "vue-i18n": "^8.18.1", "vue-moment": "^4.1.0", "vue-observe-visibility": "^0.4.6", "vue-router": "~3.0", @@ -51,6 +52,7 @@ "@babel/plugin-syntax-import-meta": "~7.2", "@babel/polyfill": "~7.2", "@babel/preset-env": "^7.9.0", + "@kazupon/vue-i18n-loader": "^0.5.0", "@vue/babel-preset-app": "^4.1.2", "@vue/cli-plugin-babel": "^4.1.0", "@vue/cli-service": "^4.2.3", diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 323a7651..8a8d0dad 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -6,7 +6,6 @@