From 66357162f8e1227495f09bd4f68446aad7071c6d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 12 Aug 2020 10:40:04 +0200 Subject: 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 --- client/src/app/shared/shared-main/misc/help.component.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'client/src/app/shared/shared-main/misc') 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 @@ 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 { PeerTubeTemplateDirective } from '../angular' @Component({ @@ -22,8 +21,6 @@ export class HelpComponent implements OnInit, OnChanges, AfterContentInit { customHtmlTemplate: TemplateRef postHtmlTemplate: TemplateRef - constructor (private i18n: I18n) { } - ngOnInit () { this.init() } @@ -71,17 +68,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]) -- cgit v1.2.3