fix(language): load locale during build of app.vue

This commit is contained in:
SabreCat
2021-11-18 11:00:01 -06:00
parent 30a5c3f91b
commit c7c17dbb55
2 changed files with 27 additions and 20 deletions

View File

@@ -406,7 +406,10 @@ export default {
this.$store.state.isUserLoaded = true;
Analytics.setUser();
Analytics.updateUser();
return axios.get('/api/v4/i18n/browser-script', { language: this.user.preferences.language });
}).then(() => {
const i18nData = window && window['habitica-i18n'];
this.$loadLocale(i18nData);
this.hideLoadingScreen();
// Adjust the timezone offset