@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.
- package/app/eo-client/settings/settings.component.d.ts +2 -0
- package/app/eo-framework/app-shell/app-bar/app-layout/app-layout.component.d.ts +3 -1
- package/app/eo-framework/form-elements/datetime-range/datetime-range.component.d.ts +1 -0
- package/app/eo-framework-core/agent/agent.service.d.ts +16 -1
- package/assets/_default/config/extend.json +3 -2
- package/assets/_default/config/main.json +4 -0
- package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.js +16 -8
- package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.js.map +1 -1
- package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.min.js +2 -2
- package/bundles/eo-sdk-client-projects-eo-sdk-core.umd.min.js.map +1 -1
- package/bundles/eo-sdk-client.umd.js +74 -37
- package/bundles/eo-sdk-client.umd.js.map +1 -1
- package/bundles/eo-sdk-client.umd.min.js +1 -1
- package/bundles/eo-sdk-client.umd.min.js.map +1 -1
- package/eo-sdk-client.d.ts +9 -8
- package/eo-sdk-client.metadata.json +1 -1
- package/esm2015/app/eo-client/about-state/about-state.component.js +3 -3
- package/esm2015/app/eo-client/settings/settings.component.js +16 -6
- package/esm2015/app/eo-framework/app-shell/app-bar/app-layout/app-layout.component.js +9 -4
- package/esm2015/app/eo-framework/app-shell/app-bar/app-search/app-search.component.js +13 -10
- package/esm2015/app/eo-framework/form-elements/checkbox/checkbox.component.js +9 -4
- package/esm2015/app/eo-framework/form-elements/datetime-range/datetime-range.component.js +5 -4
- package/esm2015/app/eo-framework/inbox-details/inbox-details.component.js +2 -2
- package/esm2015/app/eo-framework/object-details/object-details.component.js +2 -1
- package/esm2015/app/eo-framework/object-form/object-form/form-element-table/form-element-table.component.js +4 -1
- package/esm2015/app/eo-framework-core/agent/agent.service.js +16 -8
- package/esm2015/app/eo-framework-core/pipes/locale-date.pipe.js +2 -2
- package/esm2015/eo-sdk-client.js +10 -9
- package/esm2015/projects/eo-sdk/core/lib/config/translate-json-loader.js +13 -6
- package/fesm2015/eo-sdk-client-projects-eo-sdk-core.js +13 -6
- package/fesm2015/eo-sdk-client-projects-eo-sdk-core.js.map +1 -1
- package/fesm2015/eo-sdk-client.js +66 -31
- package/fesm2015/eo-sdk-client.js.map +1 -1
- package/package.json +2 -2
- package/projects/eo-sdk/core/eo-sdk-client-projects-eo-sdk-core.metadata.json +1 -1
- package/projects/eo-sdk/core/lib/config/translate-json-loader.d.ts +1 -0
- 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 {
|
|
6
|
-
import {
|
|
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
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
}
|