@vendure/admin-ui 3.1.2 → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7838,7 +7838,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
7838
7838
  }], ctorParameters: () => [{ type: AlertsService }] });
7839
7839
 
7840
7840
  // Auto-generated by the set-version.js script.
7841
- const ADMIN_UI_VERSION = '3.1.2';
7841
+ const ADMIN_UI_VERSION = '3.1.4';
7842
7842
 
7843
7843
  /* eslint-disable @angular-eslint/directive-selector */
7844
7844
  class FormFieldControlDirective {
@@ -20562,12 +20562,14 @@ class CoreModule {
20562
20562
  .map(l => `"${l}"`)
20563
20563
  .join(', ')}]`);
20564
20564
  }
20565
- if (!!defaultLocale && !availableLocales.includes(defaultLocale)) {
20566
- throw new Error(`The defaultLocale "${defaultLocale}" must be one of the availableLocales [${availableLocales
20567
- .map(l => `"${l}"`)
20568
- .join(', ')}]`);
20569
- }
20570
20565
  const uiLanguage = lastLanguage && availableLanguages.includes(lastLanguage) ? lastLanguage : defaultLanguage;
20566
+ // The locale detected from the `navigator.language` API might not be one of the
20567
+ // "available" locales. In this case, we should still allow the app to load
20568
+ // and add the detected locale to the available options.
20569
+ if (defaultLocale && !availableLocales.includes(defaultLocale)) {
20570
+ console.info(`Adding default locale ${defaultLocale} to the list of available locales`);
20571
+ availableLocales.unshift(defaultLocale);
20572
+ }
20571
20573
  this.localStorageService.set('uiLanguageCode', uiLanguage);
20572
20574
  this.i18nService.setLanguage(uiLanguage);
20573
20575
  this.i18nService.setDefaultLanguage(defaultLanguage);