diff options
Diffstat (limited to 'client/src/app/+my-account/my-account-settings/my-account-notification-preferences')
-rw-r--r-- | client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts index b892ab479..bcbea7fad 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts | |||
@@ -3,7 +3,6 @@ import { Subject } from 'rxjs' | |||
3 | import { Component, Input, OnInit } from '@angular/core' | 3 | import { Component, Input, OnInit } from '@angular/core' |
4 | import { Notifier, ServerService, User } from '@app/core' | 4 | import { Notifier, ServerService, User } from '@app/core' |
5 | import { UserNotificationService } from '@app/shared/shared-main' | 5 | import { UserNotificationService } from '@app/shared/shared-main' |
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
7 | import { UserNotificationSetting, UserNotificationSettingValue, UserRight } from '@shared/models' | 6 | import { UserNotificationSetting, UserNotificationSettingValue, UserRight } from '@shared/models' |
8 | 7 | ||
9 | @Component({ | 8 | @Component({ |
@@ -25,26 +24,25 @@ export class MyAccountNotificationPreferencesComponent implements OnInit { | |||
25 | private savePreferences = debounce(this.savePreferencesImpl.bind(this), 500) | 24 | private savePreferences = debounce(this.savePreferencesImpl.bind(this), 500) |
26 | 25 | ||
27 | constructor ( | 26 | constructor ( |
28 | private i18n: I18n, | ||
29 | private userNotificationService: UserNotificationService, | 27 | private userNotificationService: UserNotificationService, |
30 | private serverService: ServerService, | 28 | private serverService: ServerService, |
31 | private notifier: Notifier | 29 | private notifier: Notifier |
32 | ) { | 30 | ) { |
33 | this.labelNotifications = { | 31 | this.labelNotifications = { |
34 | newVideoFromSubscription: this.i18n('New video from your subscriptions'), | 32 | newVideoFromSubscription: $localize`New video from your subscriptions`, |
35 | newCommentOnMyVideo: this.i18n('New comment on your video'), | 33 | newCommentOnMyVideo: $localize`New comment on your video`, |
36 | abuseAsModerator: this.i18n('New abuse'), | 34 | abuseAsModerator: $localize`New abuse`, |
37 | videoAutoBlacklistAsModerator: this.i18n('Video blocked automatically waiting review'), | 35 | videoAutoBlacklistAsModerator: $localize`Video blocked automatically waiting review`, |
38 | blacklistOnMyVideo: this.i18n('One of your video is blocked/unblocked'), | 36 | blacklistOnMyVideo: $localize`One of your video is blocked/unblocked`, |
39 | myVideoPublished: this.i18n('Video published (after transcoding/scheduled update)'), | 37 | myVideoPublished: $localize`Video published (after transcoding/scheduled update)`, |
40 | myVideoImportFinished: this.i18n('Video import finished'), | 38 | myVideoImportFinished: $localize`Video import finished`, |
41 | newUserRegistration: this.i18n('A new user registered on your instance'), | 39 | newUserRegistration: $localize`A new user registered on your instance`, |
42 | newFollow: this.i18n('You or your channel(s) has a new follower'), | 40 | newFollow: $localize`You or your channel(s) has a new follower`, |
43 | commentMention: this.i18n('Someone mentioned you in video comments'), | 41 | commentMention: $localize`Someone mentioned you in video comments`, |
44 | newInstanceFollower: this.i18n('Your instance has a new follower'), | 42 | newInstanceFollower: $localize`Your instance has a new follower`, |
45 | autoInstanceFollowing: this.i18n('Your instance automatically followed another instance'), | 43 | autoInstanceFollowing: $localize`Your instance automatically followed another instance`, |
46 | abuseNewMessage: this.i18n('An abuse report received a new message'), | 44 | abuseNewMessage: $localize`An abuse report received a new message`, |
47 | abuseStateChange: this.i18n('One of your abuse reports has been accepted or rejected by moderators') | 45 | abuseStateChange: $localize`One of your abuse reports has been accepted or rejected by moderators` |
48 | } | 46 | } |
49 | this.notificationSettingKeys = Object.keys(this.labelNotifications) as (keyof UserNotificationSetting)[] | 47 | this.notificationSettingKeys = Object.keys(this.labelNotifications) as (keyof UserNotificationSetting)[] |
50 | 48 | ||
@@ -91,7 +89,7 @@ export class MyAccountNotificationPreferencesComponent implements OnInit { | |||
91 | this.userNotificationService.updateNotificationSettings(this.user, this.user.notificationSettings) | 89 | this.userNotificationService.updateNotificationSettings(this.user, this.user.notificationSettings) |
92 | .subscribe( | 90 | .subscribe( |
93 | () => { | 91 | () => { |
94 | this.notifier.success(this.i18n('Preferences saved'), undefined, 2000) | 92 | this.notifier.success($localize`Preferences saved`, undefined, 2000) |
95 | }, | 93 | }, |
96 | 94 | ||
97 | err => this.notifier.error(err.message) | 95 | err => this.notifier.error(err.message) |