1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-02 03:55:24 +02:00

Select user language before server language

This commit is contained in:
Harvey Kandola 2022-03-21 13:14:55 -04:00
parent e81cbad385
commit 7e26c003d6
3 changed files with 13 additions and 3 deletions

View file

@ -100,8 +100,15 @@ export default SimpleAuthSession.extend({
}),
locale: computed('session.content.authenticated.user', function () {
if (this.get('session.authenticator') === 'authenticator:anonymous' ||
this.get('session.content.authenticated.user.id') === '0' ) {
return this.appMeta.locale;
}
let locale = this.get('session.content.authenticated.user.locale');
if (_.isUndefined(locale) || locale === "") return this.appMeta.locale;
return locale;
}),
init() {