X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Badmin%2Foverview%2Fvideos%2Fvideo-list.component.ts;h=67e52d100e80cc47c3555fe861f807cb12d43140;hb=eaa529528cafcfb291009f9f99d296c81e792899;hp=82ff372aa4252984bf4be7ec73943666544328d6;hpb=384ba8b77a8e4805c099f5ea12b41c2ca5776e26;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+admin/overview/videos/video-list.component.ts b/client/src/app/+admin/overview/videos/video-list.component.ts index 82ff372aa..67e52d100 100644 --- a/client/src/app/+admin/overview/videos/video-list.component.ts +++ b/client/src/app/+admin/overview/videos/video-list.component.ts @@ -3,6 +3,7 @@ import { finalize } from 'rxjs/operators' import { Component, OnInit, ViewChild } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' import { AuthService, ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' +import { prepareIcu } from '@app/helpers' import { AdvancedInputFilter } from '@app/shared/shared-forms' import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' import { VideoBlockComponent, VideoBlockService } from '@app/shared/shared-moderation' @@ -196,14 +197,24 @@ export class VideoListComponent extends RestTable implements OnInit { } private async removeVideos (videos: Video[]) { - const message = $localize`Are you sure you want to delete these ${videos.length} videos?` + const message = prepareIcu($localize`Are you sure you want to delete {count, plural, =1 {this video} other {these {count} videos}}?`)( + { count: videos.length }, + $localize`Are you sure you want to delete these ${videos.length} videos?` + ) + const res = await this.confirmService.confirm(message, $localize`Delete`) if (res === false) return this.videoService.removeVideo(videos.map(v => v.id)) .subscribe({ next: () => { - this.notifier.success($localize`Deleted ${videos.length} videos.`) + this.notifier.success( + prepareIcu($localize`Deleted {count, plural, =1 {1 video} other {{count} videos}}.`)( + { count: videos.length }, + $localize`Deleted ${videos.length} videos.` + ) + ) + this.reloadData() }, @@ -215,7 +226,13 @@ export class VideoListComponent extends RestTable implements OnInit { this.videoBlockService.unblockVideo(videos.map(v => v.id)) .subscribe({ next: () => { - this.notifier.success($localize`Unblocked ${videos.length} videos.`) + this.notifier.success( + prepareIcu($localize`Unblocked {count, plural, =1 {1 video} other {{count} videos}}.`)( + { count: videos.length }, + $localize`Unblocked ${videos.length} videos.` + ) + ) + this.reloadData() }, @@ -224,9 +241,21 @@ export class VideoListComponent extends RestTable implements OnInit { } private async removeVideoFiles (videos: Video[], type: 'hls' | 'webtorrent') { - const message = type === 'hls' - ? $localize`Are you sure you want to delete ${videos.length} HLS streaming playlists?` - : $localize`Are you sure you want to delete WebTorrent files of ${videos.length} videos?` + let message: string + + if (type === 'hls') { + // eslint-disable-next-line max-len + message = prepareIcu($localize`Are you sure you want to delete {count, plural, =1 {1 HLS streaming playlist} other {{count} HLS streaming playlists}}?`)( + { count: videos.length }, + $localize`Are you sure you want to delete ${videos.length} HLS streaming playlists?` + ) + } else { + // eslint-disable-next-line max-len + message = prepareIcu($localize`Are you sure you want to delete WebTorrent files of {count, plural, =1 {1 video} other {{count} videos}}?`)( + { count: videos.length }, + $localize`Are you sure you want to delete WebTorrent files of ${videos.length} videos?` + ) + } const res = await this.confirmService.confirm(message, $localize`Delete`) if (res === false) return