Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
try catch collator set
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed Apr 15, 2018
1 parent 94ca579 commit 759ac04
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/services/i18n.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ export class I18nService implements I18nServiceAbstraction {

this.inited = true;
this.locale = this.translationLocale = locale != null ? locale : this.systemLanguage;
this.collator = new Intl.Collator(this.locale);

try {
this.collator = new Intl.Collator(this.locale);
} catch {
this.collator = null;
}

if (this.supportedTranslationLocales.indexOf(this.translationLocale) === -1) {
this.translationLocale = this.translationLocale.slice(0, 2);
Expand Down

0 comments on commit 759ac04

Please sign in to comment.