From d4e91ef61ec5e2d2661d02c70426b3abcd8a55e8 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Thu, 25 Aug 2022 17:02:55 +0100 Subject: [PATCH] allow instance language to take precedence over EN --- src/boot/after_store.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/boot/after_store.js b/src/boot/after_store.js index b1f1ee02..2a90ceee 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -1,3 +1,4 @@ +import Cookies from 'js-cookie' import { createApp } from 'vue' import { createRouter, createWebHistory } from 'vue-router' import vClickOutside from 'click-outside-vue3' @@ -58,6 +59,10 @@ const getInstanceConfig = async ({ store }) => { store.dispatch('setInstanceOption', { name: 'textlimit', value: textlimit }) store.dispatch('setInstanceOption', { name: 'accountApprovalRequired', value: data.approval_required }) + // don't override cookie if set + if (!Cookies.get('userLanguage')) { + store.dispatch('setOption', { name: 'interfaceLanguage', value: data.languages[0] }) + } if (vapidPublicKey) { store.dispatch('setInstanceOption', { name: 'vapidPublicKey', value: vapidPublicKey }) -- 2.43.0