diff options
author | Chocobozzz <me@florianbigard.com> | 2022-05-24 16:29:01 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-06-08 13:40:40 +0200 |
commit | eaa529528cafcfb291009f9f99d296c81e792899 (patch) | |
tree | c8e3562f73312fb331a363e1daeaeb4949cc8448 /client/src/app/+my-library | |
parent | e435cf44c00aba359bf0f265d06bff4841b3f7fe (diff) | |
download | PeerTube-eaa529528cafcfb291009f9f99d296c81e792899.tar.gz PeerTube-eaa529528cafcfb291009f9f99d296c81e792899.tar.zst PeerTube-eaa529528cafcfb291009f9f99d296c81e792899.zip |
Support ICU in TS components
Diffstat (limited to 'client/src/app/+my-library')
-rw-r--r-- | client/src/app/+my-library/my-history/my-history.component.ts | 10 | ||||
-rw-r--r-- | client/src/app/+my-library/my-videos/my-videos.component.ts | 15 |
2 files changed, 17 insertions, 8 deletions
diff --git a/client/src/app/+my-library/my-history/my-history.component.ts b/client/src/app/+my-library/my-history/my-history.component.ts index f6b712908..766869637 100644 --- a/client/src/app/+my-library/my-history/my-history.component.ts +++ b/client/src/app/+my-library/my-history/my-history.component.ts | |||
@@ -93,8 +93,8 @@ export class MyHistoryComponent implements OnInit, DisableForReuseHook { | |||
93 | .subscribe({ | 93 | .subscribe({ |
94 | next: () => { | 94 | next: () => { |
95 | const message = this.videosHistoryEnabled === true | 95 | const message = this.videosHistoryEnabled === true |
96 | ? $localize`Videos history is enabled` | 96 | ? $localize`Video history is enabled` |
97 | : $localize`Videos history is disabled` | 97 | : $localize`Video history is disabled` |
98 | 98 | ||
99 | this.notifier.success(message) | 99 | this.notifier.success(message) |
100 | 100 | ||
@@ -117,8 +117,8 @@ export class MyHistoryComponent implements OnInit, DisableForReuseHook { | |||
117 | } | 117 | } |
118 | 118 | ||
119 | async clearAllHistory () { | 119 | async clearAllHistory () { |
120 | const title = $localize`Delete videos history` | 120 | const title = $localize`Delete video history` |
121 | const message = $localize`Are you sure you want to delete all your videos history?` | 121 | const message = $localize`Are you sure you want to delete all your video history?` |
122 | 122 | ||
123 | const res = await this.confirmService.confirm(message, title) | 123 | const res = await this.confirmService.confirm(message, title) |
124 | if (res !== true) return | 124 | if (res !== true) return |
@@ -126,7 +126,7 @@ export class MyHistoryComponent implements OnInit, DisableForReuseHook { | |||
126 | this.userHistoryService.clearAll() | 126 | this.userHistoryService.clearAll() |
127 | .subscribe({ | 127 | .subscribe({ |
128 | next: () => { | 128 | next: () => { |
129 | this.notifier.success($localize`Videos history deleted`) | 129 | this.notifier.success($localize`Video history deleted`) |
130 | 130 | ||
131 | this.reloadData() | 131 | this.reloadData() |
132 | }, | 132 | }, |
diff --git a/client/src/app/+my-library/my-videos/my-videos.component.ts b/client/src/app/+my-library/my-videos/my-videos.component.ts index 64e56a250..c8012ec78 100644 --- a/client/src/app/+my-library/my-videos/my-videos.component.ts +++ b/client/src/app/+my-library/my-videos/my-videos.component.ts | |||
@@ -4,7 +4,7 @@ import { Component, OnInit, ViewChild } from '@angular/core' | |||
4 | import { ActivatedRoute, Router } from '@angular/router' | 4 | import { ActivatedRoute, Router } from '@angular/router' |
5 | import { AuthService, ComponentPagination, ConfirmService, Notifier, ScreenService, ServerService, User } from '@app/core' | 5 | import { AuthService, ComponentPagination, ConfirmService, Notifier, ScreenService, ServerService, User } from '@app/core' |
6 | import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook' | 6 | import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook' |
7 | import { immutableAssign } from '@app/helpers' | 7 | import { prepareIcu, immutableAssign } from '@app/helpers' |
8 | import { AdvancedInputFilter } from '@app/shared/shared-forms' | 8 | import { AdvancedInputFilter } from '@app/shared/shared-forms' |
9 | import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' | 9 | import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' |
10 | import { LiveStreamInformationComponent } from '@app/shared/shared-video-live' | 10 | import { LiveStreamInformationComponent } from '@app/shared/shared-video-live' |
@@ -167,7 +167,10 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook { | |||
167 | .map(k => parseInt(k, 10)) | 167 | .map(k => parseInt(k, 10)) |
168 | 168 | ||
169 | const res = await this.confirmService.confirm( | 169 | const res = await this.confirmService.confirm( |
170 | $localize`Do you really want to delete ${toDeleteVideosIds.length} videos?`, | 170 | prepareIcu($localize`Do you really want to delete {length, plural, =1 {this video} other {{length} videos}}?`)( |
171 | { length: toDeleteVideosIds.length }, | ||
172 | $localize`Do you really want to delete ${toDeleteVideosIds.length} videos?` | ||
173 | ), | ||
171 | $localize`Delete` | 174 | $localize`Delete` |
172 | ) | 175 | ) |
173 | if (res === false) return | 176 | if (res === false) return |
@@ -184,7 +187,13 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook { | |||
184 | .pipe(toArray()) | 187 | .pipe(toArray()) |
185 | .subscribe({ | 188 | .subscribe({ |
186 | next: () => { | 189 | next: () => { |
187 | this.notifier.success($localize`${toDeleteVideosIds.length} videos deleted.`) | 190 | this.notifier.success( |
191 | prepareIcu($localize`{length, plural, =1 {Video has been deleted} other {{length} videos have been deleted}}`)( | ||
192 | { length: toDeleteVideosIds.length }, | ||
193 | $localize`${toDeleteVideosIds.length} have been deleted.` | ||
194 | ) | ||
195 | ) | ||
196 | |||
188 | this.selection = {} | 197 | this.selection = {} |
189 | }, | 198 | }, |
190 | 199 | ||