Improvements

This commit is contained in:
Troplo 2021-01-17 02:52:25 +11:00
parent 33112cb7ae
commit cbd5ce5199
3 changed files with 52 additions and 24 deletions

View file

@ -1,11 +1,27 @@
<template>
<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>&copy; 2021 Kaverti</h1>
<div class="locale-changer">
Lang:
<b-button @click="en">en</b-button>
<b-button @click="wind">wind</b-button>
<b-button @click="debug">debug</b-button>
<b-button @click="langModal = true">{{$t('languages.title')}}</b-button>
</div>
</div>
</template>
@ -14,7 +30,7 @@ import AjaxErrorHandler from '../../assets/js/errorHandler'
export default {
name: 'locale-changer',
data () {
return { langs: ['en', 'debug', 'wind'], currentLang: this.$i18n.locale}
return { langs: ['en', 'debug', 'wind'], currentLang: this.$i18n.locale, langModal: false}
},
methods: {
en () {
@ -31,25 +47,25 @@ export default {
},
setLang () {
localStorage.setItem("lang", this.$i18n.locale);
this.axios
.put(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'users/preferences', {
lang: this.$i18n.locale
})
.then(() => {
this.axios.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'userinfo')
.then(res => {
this.$store.commit('setUsername', res.data.username)
this.$store.commit('setEmail', res.data.email)
this.$store.commit('setEmailVerified', res.data.emailVerified)
this.$store.commit('setAdmin', res.data.admin)
this.$store.commit('setDevMode', res.data.developerMode)
this.$store.commit('setTheme', res.data.theme)
this.$store.commit('setLang', res.data.lang)
})
})
.catch(e => {
AjaxErrorHandler(this.$store)(e)
})
this.axios
.put(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'users/preferences', {
lang: this.$i18n.locale
})
.then(() => {
this.axios.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'userinfo')
.then(res => {
this.$store.commit('setUsername', res.data.username)
this.$store.commit('setEmail', res.data.email)
this.$store.commit('setEmailVerified', res.data.emailVerified)
this.$store.commit('setAdmin', res.data.admin)
this.$store.commit('setDevMode', res.data.developerMode)
this.$store.commit('setTheme', res.data.theme)
this.$store.commit('setLang', res.data.lang)
})
})
.catch(e => {
AjaxErrorHandler(this.$store)(e)
})
}
},
mounted () {

View file

@ -189,6 +189,12 @@
"title": "Security"
}
},
"languages": {
"title": "Locale Selector",
"en": "English",
"wind": "Windspeak",
"debug": "Debug"
},
"currency": "Koins",
"close": "Close",
"tos": "Terms of Service",

View file

@ -189,6 +189,12 @@
"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",
"close": "I've just told the full truth to logan",
"tos": "get the fuck over it, it was never a scam",