Improvements
This commit is contained in:
parent
33112cb7ae
commit
cbd5ce5199
3 changed files with 52 additions and 24 deletions
|
@ -1,11 +1,27 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
|
<b-modal v-model="langModal">
|
||||||
|
<div class="modal-card" style="width: auto">
|
||||||
|
<header class="modal-card-head">
|
||||||
|
<p class="modal-card-title">{{$t('languages.title')}}</p>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="delete"
|
||||||
|
@click="langModal = false"/>
|
||||||
|
</header>
|
||||||
|
<section class="modal-card-body buttons">
|
||||||
|
<b-button v-if="$i18n.locale !== 'en'" @click="en" class="is-large">{{$t('languages.en')}}</b-button>
|
||||||
|
<b-button v-if="$i18n.locale === 'en'" @click="en" class="is-large is-info disabled" disabled>{{$t('languages.en')}}</b-button>
|
||||||
|
<b-button v-if="$i18n.locale !== 'wind'" @click="wind" class="is-large">{{$t('languages.wind')}}</b-button>
|
||||||
|
<b-button v-if="$i18n.locale === 'wind'" @click="en" class="is-large is-info disabled" disabled>{{$t('languages.wind')}}</b-button>
|
||||||
|
<b-button v-if="$i18n.locale !== 'debug'" @click="debug" class="is-large">{{$t('languages.debug')}}</b-button>
|
||||||
|
<b-button v-if="$i18n.locale === 'debug'" @click="en" class="is-large is-info disabled" disabled>{{$t('languages.debug')}}</b-button>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</b-modal>
|
||||||
<h1>© 2021 Kaverti</h1>
|
<h1>© 2021 Kaverti</h1>
|
||||||
<div class="locale-changer">
|
<div class="locale-changer">
|
||||||
Lang:
|
<b-button @click="langModal = true">{{$t('languages.title')}}</b-button>
|
||||||
<b-button @click="en">en</b-button>
|
|
||||||
<b-button @click="wind">wind</b-button>
|
|
||||||
<b-button @click="debug">debug</b-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -14,7 +30,7 @@ import AjaxErrorHandler from '../../assets/js/errorHandler'
|
||||||
export default {
|
export default {
|
||||||
name: 'locale-changer',
|
name: 'locale-changer',
|
||||||
data () {
|
data () {
|
||||||
return { langs: ['en', 'debug', 'wind'], currentLang: this.$i18n.locale}
|
return { langs: ['en', 'debug', 'wind'], currentLang: this.$i18n.locale, langModal: false}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
en () {
|
en () {
|
||||||
|
@ -31,25 +47,25 @@ export default {
|
||||||
},
|
},
|
||||||
setLang () {
|
setLang () {
|
||||||
localStorage.setItem("lang", this.$i18n.locale);
|
localStorage.setItem("lang", this.$i18n.locale);
|
||||||
this.axios
|
this.axios
|
||||||
.put(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'users/preferences', {
|
.put(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'users/preferences', {
|
||||||
lang: this.$i18n.locale
|
lang: this.$i18n.locale
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.axios.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'userinfo')
|
this.axios.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'userinfo')
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$store.commit('setUsername', res.data.username)
|
this.$store.commit('setUsername', res.data.username)
|
||||||
this.$store.commit('setEmail', res.data.email)
|
this.$store.commit('setEmail', res.data.email)
|
||||||
this.$store.commit('setEmailVerified', res.data.emailVerified)
|
this.$store.commit('setEmailVerified', res.data.emailVerified)
|
||||||
this.$store.commit('setAdmin', res.data.admin)
|
this.$store.commit('setAdmin', res.data.admin)
|
||||||
this.$store.commit('setDevMode', res.data.developerMode)
|
this.$store.commit('setDevMode', res.data.developerMode)
|
||||||
this.$store.commit('setTheme', res.data.theme)
|
this.$store.commit('setTheme', res.data.theme)
|
||||||
this.$store.commit('setLang', res.data.lang)
|
this.$store.commit('setLang', res.data.lang)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
AjaxErrorHandler(this.$store)(e)
|
AjaxErrorHandler(this.$store)(e)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
|
|
@ -189,6 +189,12 @@
|
||||||
"title": "Security"
|
"title": "Security"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"languages": {
|
||||||
|
"title": "Locale Selector",
|
||||||
|
"en": "English",
|
||||||
|
"wind": "Windspeak",
|
||||||
|
"debug": "Debug"
|
||||||
|
},
|
||||||
"currency": "Koins",
|
"currency": "Koins",
|
||||||
"close": "Close",
|
"close": "Close",
|
||||||
"tos": "Terms of Service",
|
"tos": "Terms of Service",
|
||||||
|
|
|
@ -189,6 +189,12 @@
|
||||||
"title": "Security"
|
"title": "Security"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"languages": {
|
||||||
|
"title": "(Locale Select) can you put out an announcement on the kaverti server",
|
||||||
|
"en": "(English) ill pay extra with the tet domain if u do £50 infact £100",
|
||||||
|
"wind": "(Windspeak) are you having a bubble",
|
||||||
|
"debug": "(Debug) hello mr trooooplooo"
|
||||||
|
},
|
||||||
"currency": "fuck you",
|
"currency": "fuck you",
|
||||||
"close": "I've just told the full truth to logan",
|
"close": "I've just told the full truth to logan",
|
||||||
"tos": "get the fuck over it, it was never a scam",
|
"tos": "get the fuck over it, it was never a scam",
|
||||||
|
|
Loading…
Reference in a new issue