import { AuthService } from '@app/core'
import { Hotkey, HotkeysService } from 'angular2-hotkeys'
import { SubscribeButtonComponent } from '@app/shared/user-subscription/subscribe-button.component'
+import { I18n } from '@ngx-translate/i18n-polyfill'
@Component({
templateUrl: './video-channels.component.html',
private routeSub: Subscription
constructor (
+ private i18n: I18n,
private route: ActivatedRoute,
private authService: AuthService,
private videoChannelService: VideoChannelService,
ngOnInit () {
this.routeSub = this.route.params
.pipe(
- map(params => params[ 'videoChannelId' ]),
+ map(params => params[ 'videoChannelName' ]),
distinctUntilChanged(),
- switchMap(videoChannelId => this.videoChannelService.getVideoChannel(videoChannelId)),
+ switchMap(videoChannelName => this.videoChannelService.getVideoChannel(videoChannelName)),
catchError(err => this.restExtractor.redirectTo404IfNotFound(err, [ 400, 404 ]))
)
.subscribe(videoChannel => this.videoChannel = videoChannel)
this.subscribeButton.unsubscribe() :
this.subscribeButton.subscribe()
return false
- }, undefined, 'Subscribe to the account')
+ }, undefined, this.i18n('Subscribe to the account'))
]
if (this.isUserLoggedIn()) this.hotkeysService.add(this.hotkeys)
}