X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-main%2Fmisc%2Fhelp.component.ts;h=9647e05bdfd6aef7c4ea1bb2e6c3d48004e1de33;hb=f95628636b6ccdf3eae2449ca718e075b072f678;hp=0825b96de3acea29eafa14e969b3c8332e6c571e;hpb=67ed6552b831df66713bac9e672738796128d33f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-main/misc/help.component.ts b/client/src/app/shared/shared-main/misc/help.component.ts index 0825b96de..9647e05bd 100644 --- a/client/src/app/shared/shared-main/misc/help.component.ts +++ b/client/src/app/shared/shared-main/misc/help.component.ts @@ -1,6 +1,6 @@ import { AfterContentInit, Component, ContentChildren, Input, OnChanges, OnInit, QueryList, TemplateRef } from '@angular/core' import { MarkdownService } from '@app/core' -import { I18n } from '@ngx-translate/i18n-polyfill' +import { GlobalIconName } from '@app/shared/shared-icons' import { PeerTubeTemplateDirective } from '../angular' @Component({ @@ -12,6 +12,9 @@ import { PeerTubeTemplateDirective } from '../angular' export class HelpComponent implements OnInit, OnChanges, AfterContentInit { @Input() helpType: 'custom' | 'markdownText' | 'markdownEnhanced' = 'custom' @Input() tooltipPlacement = 'right auto' + @Input() iconName: GlobalIconName = 'help' + @Input() title = $localize`Get help` + @Input() autoClose = 'outside' @ContentChildren(PeerTubeTemplateDirective) templates: QueryList> @@ -22,8 +25,6 @@ export class HelpComponent implements OnInit, OnChanges, AfterContentInit { customHtmlTemplate: TemplateRef postHtmlTemplate: TemplateRef - constructor (private i18n: I18n) { } - ngOnInit () { this.init() } @@ -71,17 +72,17 @@ export class HelpComponent implements OnInit, OnChanges, AfterContentInit { private formatMarkdownSupport (rules: string[]) { // tslint:disable:max-line-length - return this.i18n('Markdown compatible that supports:') + + return $localize`Markdown compatible that supports:` + this.createMarkdownList(rules) } private createMarkdownList (rules: string[]) { const rulesToText = { - 'emphasis': this.i18n('Emphasis'), - 'link': this.i18n('Links'), - 'newline': this.i18n('New lines'), - 'list': this.i18n('Lists'), - 'image': this.i18n('Images') + 'emphasis': $localize`Emphasis`, + 'link': $localize`Links`, + 'newline': $localize`New lines`, + 'list': $localize`Lists`, + 'image': $localize`Images` } const bullets = rules.map(r => rulesToText[r])