monkey-front-core 0.0.446 → 0.0.447
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 +23 -5
- package/fesm2015/monkey-front-core.mjs +22 -4
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +22 -4
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/services/config/monkeyecx-i18n-config.service.d.ts +1 -1
- package/monkey-front-core-0.0.447.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.446.tgz +0 -0
|
@@ -3308,12 +3308,30 @@ class MonkeyEcxi18nConfigService extends MonkeyEcxCommonsService {
|
|
|
3308
3308
|
this.translateService.use('pt-BR');
|
|
3309
3309
|
}
|
|
3310
3310
|
apply(params, environment, change = false) {
|
|
3311
|
-
this.applyInternal(environment);
|
|
3311
|
+
this.applyInternal(environment, params, change);
|
|
3312
3312
|
this.applyExternal(params, environment, change);
|
|
3313
3313
|
}
|
|
3314
|
-
async applyInternal(environment) {
|
|
3315
|
-
const { monkeyecxService, monkeyecxErrorConfigService } = this;
|
|
3316
|
-
|
|
3314
|
+
async applyInternal(environment, params = {}, change = false) {
|
|
3315
|
+
const { monkeyecxService, monkeyecxErrorConfigService, monkeyecxCookieStorageService } = this;
|
|
3316
|
+
let lang = '';
|
|
3317
|
+
let i18n = { lang: '' };
|
|
3318
|
+
try {
|
|
3319
|
+
if (!change) {
|
|
3320
|
+
const cookie = monkeyecxCookieStorageService.getCookie('monkey-app-locale');
|
|
3321
|
+
if (cookie) {
|
|
3322
|
+
i18n = JSON.parse(atob(cookie));
|
|
3323
|
+
}
|
|
3324
|
+
}
|
|
3325
|
+
else {
|
|
3326
|
+
i18n = {
|
|
3327
|
+
lang: params.lang
|
|
3328
|
+
};
|
|
3329
|
+
}
|
|
3330
|
+
}
|
|
3331
|
+
catch (e) {
|
|
3332
|
+
// not to do
|
|
3333
|
+
}
|
|
3334
|
+
lang = i18n?.lang || `${environment?.lang || 'pt-BR'}`;
|
|
3317
3335
|
try {
|
|
3318
3336
|
const currenti18n = await monkeyecxService
|
|
3319
3337
|
?.get(`${environment.localAssets}/i18n/${lang}.json`)
|