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.
@@ -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
  }