From eaa529528cafcfb291009f9f99d296c81e792899 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 24 May 2022 16:29:01 +0200 Subject: Support ICU in TS components --- .../app/+my-library/my-history/my-history.component.ts | 10 +++++----- .../src/app/+my-library/my-videos/my-videos.component.ts | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 8 deletions(-) (limited to 'client/src/app/+my-library') 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 { .subscribe({ next: () => { const message = this.videosHistoryEnabled === true - ? $localize`Videos history is enabled` - : $localize`Videos history is disabled` + ? $localize`Video history is enabled` + : $localize`Video history is disabled` this.notifier.success(message) @@ -117,8 +117,8 @@ export class MyHistoryComponent implements OnInit, DisableForReuseHook { } async clearAllHistory () { - const title = $localize`Delete videos history` - const message = $localize`Are you sure you want to delete all your videos history?` + const title = $localize`Delete video history` + const message = $localize`Are you sure you want to delete all your video history?` const res = await this.confirmService.confirm(message, title) if (res !== true) return @@ -126,7 +126,7 @@ export class MyHistoryComponent implements OnInit, DisableForReuseHook { this.userHistoryService.clearAll() .subscribe({ next: () => { - this.notifier.success($localize`Videos history deleted`) + this.notifier.success($localize`Video history deleted`) this.reloadData() }, 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' import { ActivatedRoute, Router } from '@angular/router' import { AuthService, ComponentPagination, ConfirmService, Notifier, ScreenService, ServerService, User } from '@app/core' import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook' -import { immutableAssign } from '@app/helpers' +import { prepareIcu, immutableAssign } from '@app/helpers' import { AdvancedInputFilter } from '@app/shared/shared-forms' import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' import { LiveStreamInformationComponent } from '@app/shared/shared-video-live' @@ -167,7 +167,10 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook { .map(k => parseInt(k, 10)) const res = await this.confirmService.confirm( - $localize`Do you really want to delete ${toDeleteVideosIds.length} videos?`, + prepareIcu($localize`Do you really want to delete {length, plural, =1 {this video} other {{length} videos}}?`)( + { length: toDeleteVideosIds.length }, + $localize`Do you really want to delete ${toDeleteVideosIds.length} videos?` + ), $localize`Delete` ) if (res === false) return @@ -184,7 +187,13 @@ export class MyVideosComponent implements OnInit, DisableForReuseHook { .pipe(toArray()) .subscribe({ next: () => { - this.notifier.success($localize`${toDeleteVideosIds.length} videos deleted.`) + this.notifier.success( + prepareIcu($localize`{length, plural, =1 {Video has been deleted} other {{length} videos have been deleted}}`)( + { length: toDeleteVideosIds.length }, + $localize`${toDeleteVideosIds.length} have been deleted.` + ) + ) + this.selection = {} }, -- cgit v1.2.3