monkey-front-core 0.0.209 → 0.0.210
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 +19 -20
- package/fesm2015/monkey-front-core.mjs +16 -17
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +18 -19
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/monkey-front-core-0.0.210.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.209.tgz +0 -0
|
@@ -2742,6 +2742,24 @@ class MonkeyEcxi18nConfigService extends MonkeyEcxCommonsService {
|
|
|
2742
2742
|
else {
|
|
2743
2743
|
monkeyecxCookieStorageService.setCookie('monkey-app-locale', btoa(JSON.stringify(i18n)), environment);
|
|
2744
2744
|
}
|
|
2745
|
+
try {
|
|
2746
|
+
const externali18nPaths = params?.i18n?.paths || [];
|
|
2747
|
+
const services = externali18nPaths?.map((url) => {
|
|
2748
|
+
return monkeyecxService?.get(`${url}/${i18n?.lang}.json`).pipe(take(1)).toPromise();
|
|
2749
|
+
});
|
|
2750
|
+
if (!services?.length)
|
|
2751
|
+
return;
|
|
2752
|
+
const externali18nData = await Promise.all(services);
|
|
2753
|
+
externali18nData?.forEach((config) => {
|
|
2754
|
+
const { lang } = config;
|
|
2755
|
+
const { data } = config;
|
|
2756
|
+
this.translateService.setTranslation('pt-BR', data, true);
|
|
2757
|
+
this.translateService.setTranslation(lang, data, true);
|
|
2758
|
+
});
|
|
2759
|
+
}
|
|
2760
|
+
catch (err) {
|
|
2761
|
+
// not to do
|
|
2762
|
+
}
|
|
2745
2763
|
try {
|
|
2746
2764
|
const currenti18n = await monkeyecxService?.get(`${environment.localAssets}/i18n/${i18n?.lang}.json`).pipe(take(1)).toPromise();
|
|
2747
2765
|
const { lang } = currenti18n;
|
|
@@ -2760,25 +2778,6 @@ class MonkeyEcxi18nConfigService extends MonkeyEcxCommonsService {
|
|
|
2760
2778
|
console.error(`i18n ${i18n?.lang} not found!`);
|
|
2761
2779
|
monkeyecxErrorConfigService.apply('i18n');
|
|
2762
2780
|
throwError(err);
|
|
2763
|
-
return;
|
|
2764
|
-
}
|
|
2765
|
-
try {
|
|
2766
|
-
const externali18nPaths = params?.i18n?.paths || [];
|
|
2767
|
-
const services = externali18nPaths?.map((url) => {
|
|
2768
|
-
return monkeyecxService?.get(`${url}/${i18n?.lang}.json`).pipe(take(1)).toPromise();
|
|
2769
|
-
});
|
|
2770
|
-
if (!services?.length)
|
|
2771
|
-
return;
|
|
2772
|
-
const externali18nData = await Promise.all(services);
|
|
2773
|
-
externali18nData?.forEach((config) => {
|
|
2774
|
-
const { lang } = config;
|
|
2775
|
-
const { data } = config;
|
|
2776
|
-
this.translateService.setTranslation('pt-BR', data, true);
|
|
2777
|
-
this.translateService.setTranslation(lang, data, true);
|
|
2778
|
-
});
|
|
2779
|
-
}
|
|
2780
|
-
catch (err) {
|
|
2781
|
-
// not to do
|
|
2782
2781
|
}
|
|
2783
2782
|
}
|
|
2784
2783
|
}
|