monkey-front-core 0.0.520 → 0.0.522
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.
- package/esm2020/lib/core/services/config/monkeyecx-i18n-config.service.mjs +9 -1
- package/fesm2015/monkey-front-core.mjs +8 -0
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +8 -0
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/services/config/monkeyecx-i18n-config.service.d.ts +1 -0
- package/monkey-front-core-0.0.522.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.520.tgz +0 -0
|
@@ -3683,12 +3683,14 @@ class MonkeyEcxi18nConfigService extends MonkeyEcxCommonsService {
|
|
|
3683
3683
|
super(monkeyecxService, tokenStorage);
|
|
3684
3684
|
this.translateService = translateService;
|
|
3685
3685
|
this.monkeyecxErrorConfigService = monkeyecxErrorConfigService;
|
|
3686
|
+
this.i18nNotFound = false;
|
|
3686
3687
|
}
|
|
3687
3688
|
async loadInternalDefaultFromError(environment) {
|
|
3688
3689
|
const lang = 'pt-BR';
|
|
3689
3690
|
const url = `${environment.localAssets}/i18n/${lang}.json`;
|
|
3690
3691
|
const resp = await this.monkeyecxService?.get(url).pipe(take(1)).toPromise();
|
|
3691
3692
|
this.translateService.setTranslation(lang, resp.data, true);
|
|
3693
|
+
this.i18nNotFound = true;
|
|
3692
3694
|
}
|
|
3693
3695
|
async loadDefaultFromError(environment, name) {
|
|
3694
3696
|
const lang = 'pt-BR';
|
|
@@ -3698,6 +3700,7 @@ class MonkeyEcxi18nConfigService extends MonkeyEcxCommonsService {
|
|
|
3698
3700
|
});
|
|
3699
3701
|
const resp = await this.monkeyecxService?.get(url).pipe(take(1)).toPromise();
|
|
3700
3702
|
this.translateService.setTranslation(lang, resp.data, true);
|
|
3703
|
+
this.i18nNotFound = true;
|
|
3701
3704
|
}
|
|
3702
3705
|
async loadAuth(environment, lang) {
|
|
3703
3706
|
try {
|
|
@@ -3789,6 +3792,11 @@ class MonkeyEcxi18nConfigService extends MonkeyEcxCommonsService {
|
|
|
3789
3792
|
this.loadAlerts(environment, lang);
|
|
3790
3793
|
this.loadShared(environment, lang);
|
|
3791
3794
|
this.loadRegister(environment, lang);
|
|
3795
|
+
if (this.i18nNotFound) {
|
|
3796
|
+
this.translateService.setDefaultLang('pt-br');
|
|
3797
|
+
this.translateService.use('pt-BR');
|
|
3798
|
+
return;
|
|
3799
|
+
}
|
|
3792
3800
|
this.translateService.setDefaultLang(lang);
|
|
3793
3801
|
this.translateService.use(lang);
|
|
3794
3802
|
}
|