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 --- .../videos-list-common-page.component.ts | 25 +++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'client/src/app/+videos') diff --git a/client/src/app/+videos/video-list/videos-list-common-page.component.ts b/client/src/app/+videos/video-list/videos-list-common-page.component.ts index d2782036b..c8fa8ef30 100644 --- a/client/src/app/+videos/video-list/videos-list-common-page.component.ts +++ b/client/src/app/+videos/video-list/videos-list-common-page.component.ts @@ -204,13 +204,28 @@ export class VideosListCommonPageComponent implements OnInit, OnDestroy, Disable if ([ 'hot', 'trending', 'likes', 'views' ].includes(sanitizedSort)) { this.title = $localize`Trending` - if (sanitizedSort === 'hot') this.titleTooltip = $localize`Videos with the most interactions for recent videos` - if (sanitizedSort === 'likes') this.titleTooltip = $localize`Videos that have the most likes` - if (sanitizedSort === 'views') this.titleTooltip = undefined + if (sanitizedSort === 'hot') { + this.titleTooltip = $localize`Videos with the most interactions for recent videos` + return + } + + if (sanitizedSort === 'likes') { + this.titleTooltip = $localize`Videos that have the most likes` + return + } + + if (sanitizedSort === 'views') { + this.titleTooltip = undefined + return + } if (sanitizedSort === 'trending') { - if (this.trendingDays === 1) this.titleTooltip = $localize`Videos with the most views during the last 24 hours` - else this.titleTooltip = $localize`Videos with the most views during the last ${this.trendingDays} days` + if (this.trendingDays === 1) { + this.titleTooltip = $localize`Videos with the most views during the last 24 hours` + return + } + + this.titleTooltip = $localize`Videos with the most views during the last ${this.trendingDays} days` } return -- cgit v1.2.3