Skip to content

Commit

Permalink
perf: i18n cookie default en and expired 365d and remove storage i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
BaiJiangJie committed Jun 13, 2024
1 parent 832303b commit 5eb902e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/app/services/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class I18nService {
public initialLang() {
// 语言初始化(若未设置语言, 则取浏览器语言)
const currentLanguage = this.getLangCode();
this._translate.setDefaultLang('zh');
this._translate.setDefaultLang('en');
this._translate.use(currentLanguage);

this._logger.debug('Lang is: ', currentLanguage);
Expand Down Expand Up @@ -67,7 +67,6 @@ export class I18nService {
} else {
useLang = 'zh-hans';
}
this._cookie.set('django_language', useLang, 30, '/');
localStorage.setItem('lang', useLang);
this._cookie.set('django_language', useLang, 365, '/');
}
}

0 comments on commit 5eb902e

Please sign in to comment.