diff --git a/client/src/components/menu.vue b/client/src/components/menu.vue index 351a99a..bbe4ff4 100644 --- a/client/src/components/menu.vue +++ b/client/src/components/menu.vue @@ -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 + } + } } diff --git a/client/src/plugins/i18n.ts b/client/src/plugins/i18n.ts index e5d5b40..6b199e8 100644 --- a/client/src/plugins/i18n.ts +++ b/client/src/plugins/i18n.ts @@ -6,5 +6,6 @@ Vue.use(VueI18n) export const i18n = new VueI18n({ locale: 'en', + fallbackLocale: 'en', messages, }) diff --git a/docs/changelog.md b/docs/changelog.md index 26715e1..82e7bae 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -4,6 +4,7 @@ ### New Features - Added nvidia support for firefox. +- Added `?lang=` parameter to the URL, which will set the language of the interface (by @mbattista). ## [n.eko v2.8.0](https://github.com/m1k1o/neko/releases/tag/v2.8.0) diff --git a/docs/getting-started/README.md b/docs/getting-started/README.md index 5b0b361..7b9a3a8 100644 --- a/docs/getting-started/README.md +++ b/docs/getting-started/README.md @@ -255,6 +255,7 @@ NEKO_BROADCAST_PIPELINE: "flvmux name=mux ! rtmpsink location={url} pulsesrc dev - Adding `?cast=1` will hide all control and show only video. - Adding `?embed=1` will hide most additional components and show only video. - Adding `?volume=<0-1>` will set volume to given value. + - Adding `?lang=` will set language to given value. - e.g. `http(s):///?pwd=neko&usr=guest&cast=1` ### Screen size