diff options
author | Chocobozzz <me@florianbigard.com> | 2019-01-14 09:11:28 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-01-14 09:11:28 +0100 |
commit | 7b95f31385eca59ac18197539de30268acc18986 (patch) | |
tree | fed2235f751d6a70424d1899a7a56b8761d31bc7 /client | |
parent | 033bc0efc2ab2c517b4d7d53d09930b85f092b50 (diff) | |
download | PeerTube-7b95f31385eca59ac18197539de30268acc18986.tar.gz PeerTube-7b95f31385eca59ac18197539de30268acc18986.tar.zst PeerTube-7b95f31385eca59ac18197539de30268acc18986.zip |
Help translators to translate trending title/tooltip
Diffstat (limited to 'client')
-rw-r--r-- | client/src/app/shared/video/abstract-video-list.ts | 1 | ||||
-rw-r--r-- | client/src/app/videos/video-list/video-trending.component.ts | 22 |
2 files changed, 13 insertions, 10 deletions
diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.ts index d74384293..b0633be4a 100644 --- a/client/src/app/shared/video/abstract-video-list.ts +++ b/client/src/app/shared/video/abstract-video-list.ts | |||
@@ -39,7 +39,6 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy { | |||
39 | ownerDisplayType: OwnerDisplayType = 'account' | 39 | ownerDisplayType: OwnerDisplayType = 'account' |
40 | firstLoadedPage: number | 40 | firstLoadedPage: number |
41 | displayModerationBlock = false | 41 | displayModerationBlock = false |
42 | trendingDays: number | ||
43 | titleTooltip: string | 42 | titleTooltip: string |
44 | 43 | ||
45 | protected baseVideoWidth = 215 | 44 | protected baseVideoWidth = 215 |
diff --git a/client/src/app/videos/video-list/video-trending.component.ts b/client/src/app/videos/video-list/video-trending.component.ts index d3c0f5316..881ab2174 100644 --- a/client/src/app/videos/video-list/video-trending.component.ts +++ b/client/src/app/videos/video-list/video-trending.component.ts | |||
@@ -19,7 +19,6 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit, | |||
19 | titlePage: string | 19 | titlePage: string |
20 | currentRoute = '/videos/trending' | 20 | currentRoute = '/videos/trending' |
21 | defaultSort: VideoSortField = '-trending' | 21 | defaultSort: VideoSortField = '-trending' |
22 | trendingDays: number | ||
23 | 22 | ||
24 | constructor ( | 23 | constructor ( |
25 | protected router: Router, | 24 | protected router: Router, |
@@ -33,20 +32,25 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit, | |||
33 | private videoService: VideoService | 32 | private videoService: VideoService |
34 | ) { | 33 | ) { |
35 | super() | 34 | super() |
36 | |||
37 | this.trendingDays = this.serverService.getConfig().trending.videos.intervalDays | ||
38 | |||
39 | this.titlePage = this.i18n('Trending for the last ') | ||
40 | this.trendingDays === 1 ? this.titlePage += '24 hours' : this.titlePage += this.trendingDays + ' days' | ||
41 | |||
42 | this.titleTooltip = this.i18n('trending videos are those totalizing the greatest number of views during the last ') | ||
43 | this.trendingDays === 1 ? this.titleTooltip += '24 hours.' : this.titleTooltip += this.trendingDays + ' days.' | ||
44 | } | 35 | } |
45 | 36 | ||
46 | ngOnInit () { | 37 | ngOnInit () { |
47 | super.ngOnInit() | 38 | super.ngOnInit() |
48 | 39 | ||
49 | this.generateSyndicationList() | 40 | this.generateSyndicationList() |
41 | |||
42 | const trendingDays = this.serverService.getConfig().trending.videos.intervalDays | ||
43 | |||
44 | if (trendingDays === 1) { | ||
45 | this.titlePage = this.i18n('Trending for the last 24 hours') | ||
46 | this.titleTooltip = this.i18n('Trending videos are those totalizing the greatest number of views during the last 24 hours.') | ||
47 | } else { | ||
48 | this.titlePage = this.i18n('Trending for the last {{days}} days', { days: trendingDays }) | ||
49 | this.titleTooltip = this.i18n( | ||
50 | 'Trending videos are those totalizing the greatest number of views during the last {{days}} days.', | ||
51 | { days: trendingDays } | ||
52 | ) | ||
53 | } | ||
50 | } | 54 | } |
51 | 55 | ||
52 | ngOnDestroy () { | 56 | ngOnDestroy () { |