stream-chat-angular 6.1.0 → 6.2.0
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/assets/version.d.ts +1 -1
- package/esm2020/assets/version.mjs +2 -2
- package/esm2020/lib/stream-i18n.service.mjs +15 -6
- package/fesm2015/stream-chat-angular.mjs +16 -6
- package/fesm2015/stream-chat-angular.mjs.map +1 -1
- package/fesm2020/stream-chat-angular.mjs +15 -6
- package/fesm2020/stream-chat-angular.mjs.map +1 -1
- package/lib/stream-i18n.service.d.ts +2 -2
- package/package.json +3 -3
- package/src/assets/version.ts +1 -1
|
@@ -20,7 +20,7 @@ import transliterate from '@stream-io/transliterate';
|
|
|
20
20
|
import * as i8$1 from 'angular-mentions';
|
|
21
21
|
import { MentionModule } from 'angular-mentions';
|
|
22
22
|
|
|
23
|
-
const version = '6.
|
|
23
|
+
const version = '6.2.0';
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](/chat/docs/sdk/angular/components/NotificationListComponent/) component displays the currently active notifications.
|
|
@@ -2869,8 +2869,8 @@ const en = {
|
|
|
2869
2869
|
* The `StreamI18nService` can be used to customize the labels of the chat UI. Our [translation guide](/chat/docs/sdk/angular/concepts/translation/) covers this topic in detail.
|
|
2870
2870
|
*/
|
|
2871
2871
|
class StreamI18nService {
|
|
2872
|
-
constructor(
|
|
2873
|
-
this.
|
|
2872
|
+
constructor(translateService) {
|
|
2873
|
+
this.translateService = translateService;
|
|
2874
2874
|
}
|
|
2875
2875
|
/**
|
|
2876
2876
|
* Registers the translation to the [ngx-translate](https://github.com/ngx-translate/core) TranslateService.
|
|
@@ -2878,10 +2878,19 @@ class StreamI18nService {
|
|
|
2878
2878
|
* @param overrides An object which keys are translation keys, and the values are custom translations
|
|
2879
2879
|
*/
|
|
2880
2880
|
setTranslation(lang = 'en', overrides) {
|
|
2881
|
-
|
|
2882
|
-
|
|
2881
|
+
const translateService = this.translateService;
|
|
2882
|
+
const defaultLang = 'getFallbackLang' in translateService
|
|
2883
|
+
? translateService.getFallbackLang?.()
|
|
2884
|
+
: translateService.defaultLang;
|
|
2885
|
+
if (!defaultLang) {
|
|
2886
|
+
if (typeof translateService.setDefaultLang !== 'undefined') {
|
|
2887
|
+
translateService.setDefaultLang(lang);
|
|
2888
|
+
}
|
|
2889
|
+
else {
|
|
2890
|
+
translateService.defaultLang = lang;
|
|
2891
|
+
}
|
|
2883
2892
|
}
|
|
2884
|
-
this.
|
|
2893
|
+
this.translateService.setTranslation(lang, { streamChat: { ...en.streamChat, ...overrides } }, true);
|
|
2885
2894
|
}
|
|
2886
2895
|
}
|
|
2887
2896
|
StreamI18nService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: StreamI18nService, deps: [{ token: i6.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
|