@sumaris-net/ngx-components 1.20.41 → 1.20.42

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.
@@ -18735,6 +18735,8 @@
18735
18735
  PlatformService.prototype.configureTranslate = function () {
18736
18736
  var _this = this;
18737
18737
  console.info('[platform] Configuring i18n ...');
18738
+ // this language will be used as a fallback when a translation isn't found in the current language
18739
+ this.translate.setDefaultLang(this.environment.defaultLocale);
18738
18740
  // When locale changes, apply to date adapter
18739
18741
  this.translate.onLangChange.subscribe(function (event) {
18740
18742
  if (event && event.lang) {
@@ -18756,13 +18758,16 @@
18756
18758
  _this.dateAdapter.setLocale(moment$4.locale());
18757
18759
  }
18758
18760
  });
18759
- // This language will be used as a fallback when a translation isn't found in the current language
18760
- this.translate.setDefaultLang(this.environment.defaultLocale);
18761
- // Use this language (must be called after onLangChange subscription)
18762
- this.translate.use(this.environment.defaultLocale);
18763
18761
  this.settings.onChange.subscribe(function (data) {
18764
- if (data && data.locale && data.locale !== _this.translate.currentLang) {
18765
- _this.translate.use(data.locale);
18762
+ if (data) {
18763
+ if (data.locale) {
18764
+ if (data.locale !== _this.translate.currentLang) {
18765
+ _this.translate.use(data.locale);
18766
+ }
18767
+ }
18768
+ else {
18769
+ _this.translate.use(_this.environment.defaultLocale);
18770
+ }
18766
18771
  }
18767
18772
  });
18768
18773
  // Use account's settings, (like locale), when account inheritance enabled