mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 03:57:52 +00:00
feat: Ability to set installation-wide default locale (#1433)
* Dashboard locale can be set via env variable * Change account locale based on registration page * Set account locale if available Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
@@ -28,10 +28,15 @@ export default {
|
||||
|
||||
mounted() {
|
||||
this.$store.dispatch('setUser');
|
||||
this.setLocale(window.chatwootConfig.selectedLocale);
|
||||
this.initializeAccount();
|
||||
},
|
||||
|
||||
methods: {
|
||||
setLocale(locale) {
|
||||
Vue.config.lang = locale;
|
||||
},
|
||||
|
||||
async initializeAccount() {
|
||||
const { pathname } = window.location;
|
||||
const accountId = accountIdFromPathname(pathname);
|
||||
@@ -39,7 +44,7 @@ export default {
|
||||
if (accountId) {
|
||||
await this.$store.dispatch('accounts/get');
|
||||
const { locale } = this.getAccount(accountId);
|
||||
Vue.config.lang = locale;
|
||||
this.setLocale(locale);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user