monkey-front-core 0.0.446 → 0.0.448
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 +33 -5
- package/fesm2015/monkey-front-core.mjs +32 -4
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +32 -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.448.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.446.tgz +0 -0
|
@@ -3308,12 +3308,40 @@ class MonkeyEcxi18nConfigService extends MonkeyEcxCommonsService {
|
|
|
3308
3308
|
this.translateService.use('pt-BR');
|
|
3309
3309
|
}
|
|
3310
3310
|
apply(params, environment, change = false) {
|
|
3311
|
-
|
|
3311
|
+
console.log('change no core');
|
|
3312
|
+
console.log(change);
|
|
3313
|
+
this.applyInternal(environment, params, change);
|
|
3312
3314
|
this.applyExternal(params, environment, change);
|
|
3313
3315
|
}
|
|
3314
|
-
async applyInternal(environment) {
|
|
3315
|
-
const { monkeyecxService, monkeyecxErrorConfigService } = this;
|
|
3316
|
-
|
|
3316
|
+
async applyInternal(environment, params = {}, change = false) {
|
|
3317
|
+
const { monkeyecxService, monkeyecxErrorConfigService, monkeyecxCookieStorageService } = this;
|
|
3318
|
+
let lang = '';
|
|
3319
|
+
let i18n = { lang: '' };
|
|
3320
|
+
console.log('1');
|
|
3321
|
+
try {
|
|
3322
|
+
if (!change) {
|
|
3323
|
+
console.log('2');
|
|
3324
|
+
const cookie = monkeyecxCookieStorageService.getCookie('monkey-app-locale');
|
|
3325
|
+
if (cookie) {
|
|
3326
|
+
i18n = JSON.parse(atob(cookie));
|
|
3327
|
+
}
|
|
3328
|
+
console.log('3');
|
|
3329
|
+
}
|
|
3330
|
+
else {
|
|
3331
|
+
console.log('4');
|
|
3332
|
+
i18n = {
|
|
3333
|
+
lang: params.lang
|
|
3334
|
+
};
|
|
3335
|
+
}
|
|
3336
|
+
}
|
|
3337
|
+
catch (e) {
|
|
3338
|
+
// not to do
|
|
3339
|
+
}
|
|
3340
|
+
console.log('lang no core');
|
|
3341
|
+
console.log(lang);
|
|
3342
|
+
lang = i18n?.lang || `${environment?.lang || 'pt-BR'}`;
|
|
3343
|
+
console.log('segundo lang');
|
|
3344
|
+
console.log(lang);
|
|
3317
3345
|
try {
|
|
3318
3346
|
const currenti18n = await monkeyecxService
|
|
3319
3347
|
?.get(`${environment.localAssets}/i18n/${lang}.json`)
|