]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/shared-main/buttons/edit-button.component.ts
Update build steps for localization
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / buttons / edit-button.component.ts
CommitLineData
30814423
K
1import { Component, Input, OnInit } from '@angular/core'
2import { I18n } from '@ngx-translate/i18n-polyfill'
cd83ea1b
C
3
4@Component({
5 selector: 'my-edit-button',
6 styleUrls: [ './button.component.scss' ],
7 templateUrl: './edit-button.component.html'
8})
9
30814423 10export class EditButtonComponent implements OnInit {
eacb25c4 11 @Input() label: string
30814423 12 @Input() title: string
be27ef3b 13 @Input() routerLink: string[] | string = []
30814423
K
14
15 constructor (private i18n: I18n) { }
16
17 ngOnInit () {
18 // <my-edit-button /> No label
19 if (this.label === undefined && !this.title) {
20 this.title = this.i18n('Update')
21 }
22
23 // <my-edit-button label /> Use default label
24 if (this.label === '') {
25 this.label = this.i18n('Update')
26
27 if (!this.title) {
28 this.title = this.label
29 }
30 }
31 }
cd83ea1b 32}