]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts
Migrate to $localize
[github/Chocobozzz/PeerTube.git] / client / src / app / +video-channels / video-channel-about / video-channel-about.component.ts
index ea7b0e118875f41b2945aeacfd4f37fdd98c91b2..537c7d08e385fc825bf5aba523a41a53fb7f3cb9 100644 (file)
@@ -1,9 +1,7 @@
-import { Component, OnDestroy, OnInit } from '@angular/core'
-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'
 import { Subscription } from 'rxjs'
-import { MarkdownService } from '@app/videos/shared'
+import { Component, OnDestroy, OnInit } from '@angular/core'
+import { MarkdownService } from '@app/core'
+import { VideoChannel, VideoChannelService } from '@app/shared/shared-main'
 
 @Component({
   selector: 'my-video-channel-about',
@@ -18,7 +16,6 @@ export class VideoChannelAboutComponent implements OnInit, OnDestroy {
   private videoChannelSub: Subscription
 
   constructor (
-    private i18n: I18n,
     private videoChannelService: VideoChannelService,
     private markdownService: MarkdownService
   ) { }
@@ -26,11 +23,11 @@ export class VideoChannelAboutComponent implements OnInit, OnDestroy {
   ngOnInit () {
     // Parent get the video channel for us
     this.videoChannelSub = this.videoChannelService.videoChannelLoaded
-      .subscribe(videoChannel => {
+      .subscribe(async videoChannel => {
         this.videoChannel = videoChannel
 
-        this.descriptionHTML = this.markdownService.textMarkdownToHTML(this.videoChannel.description)
-        this.supportHTML = this.markdownService.enhancedMarkdownToHTML(this.videoChannel.support)
+        this.descriptionHTML = await this.markdownService.textMarkdownToHTML(this.videoChannel.description)
+        this.supportHTML = await this.markdownService.enhancedMarkdownToHTML(this.videoChannel.support)
       })
   }
 
@@ -41,6 +38,6 @@ export class VideoChannelAboutComponent implements OnInit, OnDestroy {
   getVideoChannelDescription () {
     if (this.descriptionHTML) return this.descriptionHTML
 
-    return this.i18n('No description')
+    return $localize`No description`
   }
 }