@eo-sdk/client 8.0.0-rc.4 → 8.0.0-rc.7

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.
Files changed (37) hide show
  1. package/app/eo-client/settings/settings.component.d.ts +2 -0
  2. package/app/eo-framework/app-shell/app-bar/app-layout/app-layout.component.d.ts +3 -1
  3. package/app/eo-framework/form-elements/datetime-range/datetime-range.component.d.ts +1 -0
  4. package/app/eo-framework-core/agent/agent.service.d.ts +16 -1
  5. package/assets/_default/config/extend.json +3 -2
  6. package/assets/_default/config/main.json +4 -0
  7. package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.js +16 -8
  8. package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.js.map +1 -1
  9. package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.min.js +2 -2
  10. package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.min.js.map +1 -1
  11. package/bundles/eo-sdk-client.umd.js +74 -37
  12. package/bundles/eo-sdk-client.umd.js.map +1 -1
  13. package/bundles/eo-sdk-client.umd.min.js +1 -1
  14. package/bundles/eo-sdk-client.umd.min.js.map +1 -1
  15. package/eo-sdk-client.d.ts +9 -8
  16. package/eo-sdk-client.metadata.json +1 -1
  17. package/esm2015/app/eo-client/about-state/about-state.component.js +3 -3
  18. package/esm2015/app/eo-client/settings/settings.component.js +16 -6
  19. package/esm2015/app/eo-framework/app-shell/app-bar/app-layout/app-layout.component.js +9 -4
  20. package/esm2015/app/eo-framework/app-shell/app-bar/app-search/app-search.component.js +13 -10
  21. package/esm2015/app/eo-framework/form-elements/checkbox/checkbox.component.js +9 -4
  22. package/esm2015/app/eo-framework/form-elements/datetime-range/datetime-range.component.js +5 -4
  23. package/esm2015/app/eo-framework/inbox-details/inbox-details.component.js +2 -2
  24. package/esm2015/app/eo-framework/object-details/object-details.component.js +2 -1
  25. package/esm2015/app/eo-framework/object-form/object-form/form-element-table/form-element-table.component.js +4 -1
  26. package/esm2015/app/eo-framework-core/agent/agent.service.js +16 -8
  27. package/esm2015/app/eo-framework-core/pipes/locale-date.pipe.js +2 -2
  28. package/esm2015/eo-sdk-client.js +10 -9
  29. package/esm2015/projects/eo-sdk/core/lib/config/translate-json-loader.js +13 -6
  30. package/fesm2015/eo-sdk-client-projects-eo-sdk-core.js +13 -6
  31. package/fesm2015/eo-sdk-client-projects-eo-sdk-core.js.map +1 -1
  32. package/fesm2015/eo-sdk-client.js +66 -31
  33. package/fesm2015/eo-sdk-client.js.map +1 -1
  34. package/package.json +2 -2
  35. package/projects/eo-sdk/core/eo-sdk-client-projects-eo-sdk-core.metadata.json +1 -1
  36. package/projects/eo-sdk/core/lib/config/translate-json-loader.d.ts +1 -0
  37. package/projects/eo-sdk/core/package.json +1 -1
@@ -2,9 +2,11 @@ import { TranslateService, TranslateModule, TranslateLoader, MissingTranslationH
2
2
  export { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
3
3
  import { InjectionToken, Inject, Injectable, ɵɵdefineInjectable, ɵɵinject, NgZone, NgModule, APP_INITIALIZER, Optional, SkipSelf } from '@angular/core';
4
4
  import { HttpClient, HttpErrorResponse, HttpHeaders, HttpResponse, HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
5
- import { of, forkJoin, EMPTY, throwError, Subject, Observable, ReplaySubject, BehaviorSubject, timer, interval } from 'rxjs';
6
- import { catchError, map, filter, debounceTime, switchMap, first, tap, finalize, shareReplay, mergeMap, expand, skipWhile, takeUntil } from 'rxjs/operators';
5
+ import { forkJoin, of, EMPTY, throwError, Subject, Observable, ReplaySubject, BehaviorSubject, timer, interval } from 'rxjs';
6
+ import { map, catchError, filter, debounceTime, switchMap, first, tap, finalize, shareReplay, mergeMap, expand, skipWhile, takeUntil } from 'rxjs/operators';
7
7
  import { registerLocaleData, PlatformLocation, DatePipe } from '@angular/common';
8
+ import localeDeCh from '@angular/common/locales/de-CH';
9
+ import localeExtraDeCh from '@angular/common/locales/extra/de-CH';
8
10
  import localeDe from '@angular/common/locales/de';
9
11
  import localeExtraDe from '@angular/common/locales/extra/de';
10
12
  import localeAr from '@angular/common/locales/ar';
@@ -120,6 +122,7 @@ class EoxTranslateJsonLoader {
120
122
  registerLocaleData(localeKo, 'ko', localeExtraKo); // Korean
121
123
  registerLocaleData(localeHi, 'hi', localeExtraHi); // Hindi
122
124
  registerLocaleData(localeBn, 'bn', localeExtraBn); // Bengalese
125
+ registerLocaleData(localeDeCh, 'de-CH', localeExtraDeCh); // German (switzerland)
123
126
  }
124
127
  /**
125
128
  *
@@ -127,10 +130,14 @@ class EoxTranslateJsonLoader {
127
130
  * @returns Observable<Object>
128
131
  */
129
132
  getTranslation(lang) {
130
- const t = this.config.translations.map(folder => this.http.get(`${folder}${lang}.json`)
131
- .pipe(catchError((e) => of({}))));
132
- return forkJoin(t).pipe(map((res) => {
133
- return res.reduce((acc, x) => Object.assign(acc, x), {});
133
+ return forkJoin(this.config.translations.map(folder => this.loadTranslationFile(folder, lang))).pipe(map((res) => res.reduce((acc, x) => Object.assign(acc, x), {})));
134
+ }
135
+ loadTranslationFile(folder, lang) {
136
+ return this.http.get(`${folder}${lang}.json`).pipe(catchError((e) => {
137
+ // ISO codes with more than 2 characters are sub-languages like de-CH.
138
+ // If there is no translation file for that sub-language we'll try to load
139
+ // the file for the base language (in this case de).
140
+ return lang.length > 2 ? this.loadTranslationFile(folder, lang.substring(0, 2)) : of({});
134
141
  }));
135
142
  }
136
143
  }