mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-06 09:20:43 +01:00
try catch collator set
This commit is contained in:
parent
94ca579168
commit
759ac04ee9
@ -26,7 +26,12 @@ export class I18nService implements I18nServiceAbstraction {
|
|||||||
|
|
||||||
this.inited = true;
|
this.inited = true;
|
||||||
this.locale = this.translationLocale = locale != null ? locale : this.systemLanguage;
|
this.locale = this.translationLocale = locale != null ? locale : this.systemLanguage;
|
||||||
|
|
||||||
|
try {
|
||||||
this.collator = new Intl.Collator(this.locale);
|
this.collator = new Intl.Collator(this.locale);
|
||||||
|
} catch {
|
||||||
|
this.collator = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.supportedTranslationLocales.indexOf(this.translationLocale) === -1) {
|
if (this.supportedTranslationLocales.indexOf(this.translationLocale) === -1) {
|
||||||
this.translationLocale = this.translationLocale.slice(0, 2);
|
this.translationLocale = this.translationLocale.slice(0, 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user