diff --git a/assets/src/css/dashboard.css b/assets/src/css/dashboard.css index c873c6bc..3e8a5b17 100644 --- a/assets/src/css/dashboard.css +++ b/assets/src/css/dashboard.css @@ -48,6 +48,7 @@ form.dashboard > p:last-child { margin-bottom: 0; } +.dashboard select, .dashboard textarea, .dashboard input[type="text"], .dashboard input[type="password"] { @@ -60,12 +61,18 @@ form.dashboard > p:last-child { width: 100%; } +.dashboard #locale, .dashboard #username, .dashboard #password, .dashboard #scope { max-width: 18em; } +.dashboard #locale { + border: 1px solid #dddddd; + margin-top: .5em; +} + .dashboard textarea:focus, .dashboard textarea:hover, .dashboard input[type="text"]:focus, diff --git a/assets/src/i18n/en.yaml b/assets/src/i18n/en.yaml index 4ad40091..7608f4aa 100644 --- a/assets/src/i18n/en.yaml +++ b/assets/src/i18n/en.yaml @@ -104,6 +104,7 @@ settings: examples: Examples globalSettings: Global Settings goTo: Go to + language: Language newPassword: Your new password newPasswordConfirm: Confirm your new password newUser: New User @@ -158,3 +159,7 @@ search: type: Type and press enter to search. pressToSearch: Press enter to search. pressToExecute: Press enter to execute. +languages: + en: English + pt: Portuguese + zhCN: Chinese (Simplified) diff --git a/assets/src/i18n/index.js b/assets/src/i18n/index.js index fb495b4a..24ea77a1 100644 --- a/assets/src/i18n/index.js +++ b/assets/src/i18n/index.js @@ -2,16 +2,18 @@ import Vue from 'vue' import VueI18n from 'vue-i18n' import en from './en.yaml' import pt from './pt.yaml' -import zhCN from './zh_cn.yaml' +import zhCN from './zh-cn.yaml' Vue.use(VueI18n) -export default new VueI18n({ - locale: 'pt', +const i18n = new VueI18n({ + locale: 'en', fallbackLocale: 'en', messages: { 'en': en, 'pt': pt, - 'zh_cn': zhCN + 'zh-cn': zhCN } }) + +export default i18n diff --git a/assets/src/i18n/pt.yaml b/assets/src/i18n/pt.yaml index 0531b515..47e644b0 100644 --- a/assets/src/i18n/pt.yaml +++ b/assets/src/i18n/pt.yaml @@ -104,6 +104,7 @@ settings: examples: Exemplos globalSettings: Configurações Globais goTo: Ir para + language: Linguagem newPassword: Nova palavra-passe newPasswordConfirm: Confirme a nova palavra-passe newUser: Novo Utilizador @@ -159,3 +160,7 @@ search: type: Escreva e prima enter para pesquisar. pressToSearch: Prima enter para pesquisar. pressToExecute: Prima enter para executar. +languages: + en: Inglês + pt: Português + zhCN: Chinês (Simplificado) diff --git a/assets/src/i18n/zh_cn.yaml b/assets/src/i18n/zh-cn.yaml similarity index 100% rename from assets/src/i18n/zh_cn.yaml rename to assets/src/i18n/zh-cn.yaml diff --git a/assets/src/store/mutations.js b/assets/src/store/mutations.js index 6797ef2c..b0940d89 100644 --- a/assets/src/store/mutations.js +++ b/assets/src/store/mutations.js @@ -1,3 +1,5 @@ +import i18n from '@/i18n' + const mutations = { closeHovers: state => { state.show = null @@ -22,7 +24,10 @@ const mutations = { }, setLoading: (state, value) => { state.loading = value }, setReload: (state, value) => { state.reload = value }, - setUser: (state, value) => (state.user = value), + setUser: (state, value) => { + i18n.locale = value.locale + state.user = value + }, setUserCSS: (state, value) => (state.user.css = value), setJWT: (state, value) => (state.jwt = value), multiple: (state, value) => (state.multiple = value),