diff options
Diffstat (limited to 'client/src/app/shared/shared-main/misc/help.component.ts')
-rw-r--r-- | client/src/app/shared/shared-main/misc/help.component.ts | 15 |
1 files changed, 6 insertions, 9 deletions
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..ebc965a88 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,5 @@ | |||
1 | import { AfterContentInit, Component, ContentChildren, Input, OnChanges, OnInit, QueryList, TemplateRef } from '@angular/core' | 1 | import { AfterContentInit, Component, ContentChildren, Input, OnChanges, OnInit, QueryList, TemplateRef } from '@angular/core' |
2 | import { MarkdownService } from '@app/core' | 2 | import { MarkdownService } from '@app/core' |
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
4 | import { PeerTubeTemplateDirective } from '../angular' | 3 | import { PeerTubeTemplateDirective } from '../angular' |
5 | 4 | ||
6 | @Component({ | 5 | @Component({ |
@@ -22,8 +21,6 @@ export class HelpComponent implements OnInit, OnChanges, AfterContentInit { | |||
22 | customHtmlTemplate: TemplateRef<any> | 21 | customHtmlTemplate: TemplateRef<any> |
23 | postHtmlTemplate: TemplateRef<any> | 22 | postHtmlTemplate: TemplateRef<any> |
24 | 23 | ||
25 | constructor (private i18n: I18n) { } | ||
26 | |||
27 | ngOnInit () { | 24 | ngOnInit () { |
28 | this.init() | 25 | this.init() |
29 | } | 26 | } |
@@ -71,17 +68,17 @@ export class HelpComponent implements OnInit, OnChanges, AfterContentInit { | |||
71 | 68 | ||
72 | private formatMarkdownSupport (rules: string[]) { | 69 | private formatMarkdownSupport (rules: string[]) { |
73 | // tslint:disable:max-line-length | 70 | // tslint:disable:max-line-length |
74 | return this.i18n('<a href="https://en.wikipedia.org/wiki/Markdown#Example" target="_blank" rel="noopener noreferrer">Markdown</a> compatible that supports:') + | 71 | return $localize`<a href="https://en.wikipedia.org/wiki/Markdown#Example" target="_blank" rel="noopener noreferrer">Markdown</a> compatible that supports:` + |
75 | this.createMarkdownList(rules) | 72 | this.createMarkdownList(rules) |
76 | } | 73 | } |
77 | 74 | ||
78 | private createMarkdownList (rules: string[]) { | 75 | private createMarkdownList (rules: string[]) { |
79 | const rulesToText = { | 76 | const rulesToText = { |
80 | 'emphasis': this.i18n('Emphasis'), | 77 | 'emphasis': $localize`Emphasis`, |
81 | 'link': this.i18n('Links'), | 78 | 'link': $localize`Links`, |
82 | 'newline': this.i18n('New lines'), | 79 | 'newline': $localize`New lines`, |
83 | 'list': this.i18n('Lists'), | 80 | 'list': $localize`Lists`, |
84 | 'image': this.i18n('Images') | 81 | 'image': $localize`Images` |
85 | } | 82 | } |
86 | 83 | ||
87 | const bullets = rules.map(r => rulesToText[r]) | 84 | const bullets = rules.map(r => rulesToText[r]) |