mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-30 02:32:29 +00:00
fix: Use account locale as the default locale on widget (#6248)
* fix: Use account locale as the default locale on widget * Refactors check for invalid locale Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
committed by
GitHub
parent
d488a42664
commit
70cb0a8ed9
@@ -18,7 +18,8 @@ const runSDK = ({ baseUrl, websiteToken }) => {
|
||||
}
|
||||
|
||||
const chatwootSettings = window.chatwootSettings || {};
|
||||
let locale = chatwootSettings.locale || 'en';
|
||||
let locale = chatwootSettings.locale;
|
||||
|
||||
if (chatwootSettings.useBrowserLanguage) {
|
||||
locale = window.navigator.language.replace('-', '_');
|
||||
}
|
||||
|
||||
@@ -135,6 +135,7 @@ export default {
|
||||
});
|
||||
},
|
||||
setLocale(localeWithVariation) {
|
||||
if (!localeWithVariation) return;
|
||||
const { enabledLanguages } = window.chatwootWebChannel;
|
||||
const localeWithoutVariation = localeWithVariation.split('_')[0];
|
||||
const hasLocaleWithoutVariation = enabledLanguages.some(
|
||||
|
||||
Reference in New Issue
Block a user