From 0975cd5cf260bd06c797ac7582675ac624a47ebc Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 5 Jun 2018 16:31:52 +0200 Subject: Translate tab heads --- .../edit-custom-config.component.html | 6 ++-- client/src/app/+admin/follows/follows.component.ts | 38 +++++++++++++--------- .../shared/forms/markdown-textarea.component.html | 6 ++-- client/src/app/shared/misc/help.component.ts | 17 ++++++---- client/src/app/signup/signup.component.ts | 1 - .../+video-edit/shared/video-edit.component.html | 4 +-- 6 files changed, 40 insertions(+), 32 deletions(-) (limited to 'client/src/app') diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html index a0bd01e5e..4a6c631fb 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html @@ -2,7 +2,7 @@ - +
Instance
@@ -133,7 +133,7 @@
- +
Twitter
@@ -167,7 +167,7 @@ Check this checkbox, save the configuration and test with a video URL of your in
- +
Transcoding
diff --git a/client/src/app/+admin/follows/follows.component.ts b/client/src/app/+admin/follows/follows.component.ts index f29ad384f..f7af9826c 100644 --- a/client/src/app/+admin/follows/follows.component.ts +++ b/client/src/app/+admin/follows/follows.component.ts @@ -1,6 +1,7 @@ import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core' import { NavigationEnd, Router } from '@angular/router' import { TabsetComponent } from 'ngx-bootstrap/tabs' +import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ templateUrl: './follows.component.html', @@ -9,22 +10,27 @@ import { TabsetComponent } from 'ngx-bootstrap/tabs' export class FollowsComponent implements OnInit, AfterViewInit { @ViewChild('followsMenuTabs') followsMenuTabs: TabsetComponent - links = [ - { - path: 'following-list', - title: 'Following' - }, - { - path: 'following-add', - title: 'Follow' - }, - { - path: 'followers-list', - title: 'Followers' - } - ] - - constructor (private router: Router) {} + links: { path: string, title: string }[] = [] + + constructor ( + private i18n: I18n, + private router: Router + ) { + this.links = [ + { + path: 'following-list', + title: this.i18n('Following') + }, + { + path: 'following-add', + title: this.i18n('Follow') + }, + { + path: 'followers-list', + title: this.i18n('Followers') + } + ] + } ngOnInit () { this.router.events.subscribe( diff --git a/client/src/app/shared/forms/markdown-textarea.component.html b/client/src/app/shared/forms/markdown-textarea.component.html index 6effda5b8..802562dd7 100644 --- a/client/src/app/shared/forms/markdown-textarea.component.html +++ b/client/src/app/shared/forms/markdown-textarea.component.html @@ -1,8 +1,8 @@
diff --git a/client/src/app/shared/misc/help.component.ts b/client/src/app/shared/misc/help.component.ts index 0373a63de..e7af61b4a 100644 --- a/client/src/app/shared/misc/help.component.ts +++ b/client/src/app/shared/misc/help.component.ts @@ -1,5 +1,6 @@ import { Component, Input, OnChanges, OnInit } from '@angular/core' import { MarkdownService } from '@app/videos/shared' +import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ selector: 'my-help', @@ -16,6 +17,8 @@ export class HelpComponent implements OnInit, OnChanges { mainHtml = '' + constructor (private i18n: I18n) { } + ngOnInit () { this.init() } @@ -42,18 +45,18 @@ export class HelpComponent implements OnInit, OnChanges { } private formatMarkdownSupport (rules: string[]) { - return 'Markdown ' + - 'compatible that supports:' + + // tslint:disable:max-line-length + return this.i18n('Markdown compatible that supports:') + this.createMarkdownList(rules) } private createMarkdownList (rules: string[]) { const rulesToText = { - 'emphasis': 'Emphasis', - 'link': 'Links', - 'newline': 'New lines', - 'list': 'Lists', - 'image': 'Images' + 'emphasis': this.i18n('Emphasis'), + 'link': this.i18n('Links'), + 'newline': this.i18n('New lines'), + 'list': this.i18n('Lists'), + 'image': this.i18n('Images') } const bullets = rules.map(r => rulesToText[r]) diff --git a/client/src/app/signup/signup.component.ts b/client/src/app/signup/signup.component.ts index 55ebb573e..53d144572 100644 --- a/client/src/app/signup/signup.component.ts +++ b/client/src/app/signup/signup.component.ts @@ -75,7 +75,6 @@ export class SignupComponent extends FormReactive implements OnInit { return this.i18n('~ {{minutes}} {minutes, plural, =1 {minute} other {minutes}}', { minutes }) } - private buildQuotaHelpIndication () { if (this.initialUserVideoQuota === -1) return diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.html b/client/src/app/videos/+video-edit/shared/video-edit.component.html index bd9f69362..c8cd0d679 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.component.html +++ b/client/src/app/videos/+video-edit/shared/video-edit.component.html @@ -1,7 +1,7 @@
- +
@@ -112,7 +112,7 @@
- +