From b1d40cff89f7cff565a98cdbcea9a624196a169a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 4 Jun 2018 16:21:17 +0200 Subject: Add i18n attributes --- .../video-channel-about/video-channel-about.component.html | 8 ++++---- .../video-channel-about/video-channel-about.component.ts | 6 ++++-- .../video-channel-videos/video-channel-videos.component.ts | 12 ++++++++++-- client/src/app/+video-channels/video-channels.component.html | 10 +++++----- 4 files changed, 23 insertions(+), 13 deletions(-) (limited to 'client/src/app/+video-channels') diff --git a/client/src/app/+video-channels/video-channel-about/video-channel-about.component.html b/client/src/app/+video-channels/video-channel-about/video-channel-about.component.html index a4338121f..b7125ff71 100644 --- a/client/src/app/+video-channels/video-channel-about/video-channel-about.component.html +++ b/client/src/app/+video-channels/video-channel-about/video-channel-about.component.html @@ -1,20 +1,20 @@
-
Description
+
Description
{{ getVideoChannelDescription() }}
-
Support this channel
+
Support this channel
{{ videoChannel.support }}
-
Stats
-
Created {{ videoChannel.createdAt | date }}
+
Stats
+
Created {{ videoChannel.createdAt | date }}
\ No newline at end of file diff --git a/client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts b/client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts index 6f862718f..c5fd442c6 100644 --- a/client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts +++ b/client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core' import { ActivatedRoute } from '@angular/router' import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' import { VideoChannel } from '@app/shared/video-channel/video-channel.model' +import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ selector: 'my-video-channel-about', @@ -12,7 +13,8 @@ export class VideoChannelAboutComponent implements OnInit { videoChannel: VideoChannel constructor ( - protected route: ActivatedRoute, + private route: ActivatedRoute, + private i18n: I18n, private videoChannelService: VideoChannelService ) { } @@ -25,6 +27,6 @@ export class VideoChannelAboutComponent implements OnInit { getVideoChannelDescription () { if (this.videoChannel.description) return this.videoChannel.description - return 'No description' + return this.i18n('No description') } } diff --git a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts index c9e72e512..22239d75b 100644 --- a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts +++ b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts @@ -10,6 +10,7 @@ import { VideoService } from '../../shared/video/video.service' import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' import { VideoChannel } from '@app/shared/video-channel/video-channel.model' import { tap } from 'rxjs/operators' +import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ selector: 'my-video-channel-videos', @@ -20,7 +21,7 @@ import { tap } from 'rxjs/operators' ] }) export class VideoChannelVideosComponent extends AbstractVideoList implements OnInit, OnDestroy { - titlePage = 'Published videos' + titlePage: string marginContent = false // Disable margin currentRoute = '/video-channel/videos' loadOnInit = false @@ -34,10 +35,13 @@ export class VideoChannelVideosComponent extends AbstractVideoList implements On protected notificationsService: NotificationsService, protected confirmService: ConfirmService, protected location: Location, + protected i18n: I18n, private videoChannelService: VideoChannelService, private videoService: VideoService ) { super() + + this.titlePage = this.i18n('Published videos') } ngOnInit () { @@ -63,7 +67,11 @@ export class VideoChannelVideosComponent extends AbstractVideoList implements On return this.videoService .getVideoChannelVideos(this.videoChannel, newPagination, this.sort) - .pipe(tap(({ totalVideos }) => this.titlePage = `Published ${totalVideos} videos`)) + .pipe( + tap(({ totalVideos }) => { + this.titlePage = this.i18n('Published {{ totalVideos }} videos', { totalVideos }) + }) + ) } generateSyndicationList () { diff --git a/client/src/app/+video-channels/video-channels.component.html b/client/src/app/+video-channels/video-channels.component.html index 6b25d16ab..a52894cac 100644 --- a/client/src/app/+video-channels/video-channels.component.html +++ b/client/src/app/+video-channels/video-channels.component.html @@ -8,19 +8,19 @@
{{ videoChannel.displayName }}
-
{{ videoChannel.followersCount }} subscribers
+
{{ videoChannel.followersCount }} subscribers
- - Created by {{ videoChannel.ownerBy }} + + Created by {{ videoChannel.ownerBy }} Owner account avatar -- cgit v1.2.3