mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
lang url parameter (#296)
* lang url parameter * add ?lang to readme. --------- Co-authored-by: Miroslav Šedivý <sedivy.miro@gmail.com>
This commit is contained in:
@ -76,5 +76,12 @@
|
||||
about() {
|
||||
this.$accessor.client.toggleAbout()
|
||||
}
|
||||
|
||||
mounted() {
|
||||
const default_lang = new URL(location.href).searchParams.get('lang')
|
||||
if (default_lang && this.langs.includes(default_lang)) {
|
||||
this.$i18n.locale = default_lang
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -6,5 +6,6 @@ Vue.use(VueI18n)
|
||||
|
||||
export const i18n = new VueI18n({
|
||||
locale: 'en',
|
||||
fallbackLocale: 'en',
|
||||
messages,
|
||||
})
|
||||
|
Reference in New Issue
Block a user