aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main/misc/help.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-12 10:40:04 +0200
committerChocobozzz <me@florianbigard.com>2020-08-14 10:28:30 +0200
commit66357162f8e1227495f09bd4f68446aad7071c6d (patch)
tree7d4429506deb512b2fe1d0267f38a28cda20af55 /client/src/app/shared/shared-main/misc/help.component.ts
parent8c360747995e17eb5520e22fc3d7bd4c3d26eeee (diff)
downloadPeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.tar.gz
PeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.tar.zst
PeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.zip
Migrate to $localize
* Remove i18n polyfill to translate things in components * Reduce bundle sizes * Improve runtime perf * Reduce a lot the time to make a full client build * Reduce client build complexity * We don't need a service to translate things anymore (so we will be able to translate title pages etc) Unfortunately we may loose some translations in the migration process. I'll put a message on weblate to notify translators
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.ts15
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 @@
1import { AfterContentInit, Component, ContentChildren, Input, OnChanges, OnInit, QueryList, TemplateRef } from '@angular/core' 1import { AfterContentInit, Component, ContentChildren, Input, OnChanges, OnInit, QueryList, TemplateRef } from '@angular/core'
2import { MarkdownService } from '@app/core' 2import { MarkdownService } from '@app/core'
3import { I18n } from '@ngx-translate/i18n-polyfill'
4import { PeerTubeTemplateDirective } from '../angular' 3import { 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])