Skip to content

Commit

Permalink
Translate tab heads
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobozzz committed Jun 5, 2018
1 parent 7a9fd8b commit 0975cd5
Show file tree
Hide file tree
Showing 8 changed files with 265 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<tabset class="root-tabset bootstrap">

<tab heading="Basic configuration">
<tab i18n-heading heading="Basic configuration">

<div i18n class="inner-form-title">Instance</div>

Expand Down Expand Up @@ -133,7 +133,7 @@
</div>
</tab>

<tab heading="Services">
<tab i18n-heading heading="Services">

<div i18n class="inner-form-title">Twitter</div>

Expand Down Expand Up @@ -167,7 +167,7 @@
</div>
</tab>

<tab heading="Advanced configuration">
<tab i18n-heading heading="Advanced configuration">

<div i18n class="inner-form-title">Transcoding</div>

Expand Down
38 changes: 22 additions & 16 deletions client/src/app/+admin/follows/follows.component.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions client/src/app/shared/forms/markdown-textarea.component.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="root" [ngStyle]="{ 'flex-direction': flexDirection }">
<textarea
[(ngModel)]="content" (ngModelChange)="onModelChange()"
[ngClass]="classes" [ngStyle]="{ width: textareaWidth, height: textareaHeight, 'margin-right': textareaMarginRight }"
id="description" name="description">
[(ngModel)]="content" (ngModelChange)="onModelChange()"
[ngClass]="classes" [ngStyle]="{ width: textareaWidth, height: textareaHeight, 'margin-right': textareaMarginRight }"
id="description" name="description">
</textarea>

<tabset *ngIf="arePreviewsDisplayed()" class="previews">
Expand Down
17 changes: 10 additions & 7 deletions client/src/app/shared/misc/help.component.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -16,6 +17,8 @@ export class HelpComponent implements OnInit, OnChanges {

mainHtml = ''

constructor (private i18n: I18n) { }

ngOnInit () {
this.init()
}
Expand All @@ -42,18 +45,18 @@ export class HelpComponent implements OnInit, OnChanges {
}

private formatMarkdownSupport (rules: string[]) {
return '<a href="https://en.wikipedia.org/wiki/Markdown#Example" target="_blank" rel="noopener noreferrer">Markdown</a> ' +
'compatible that supports:' +
// tslint:disable:max-line-length
return this.i18n('<a href="https://en.wikipedia.org/wiki/Markdown#Example" target="_blank" rel="noopener noreferrer">Markdown</a> 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])
Expand Down
1 change: 0 additions & 1 deletion client/src/app/signup/signup.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="video-edit row" [formGroup]="form">
<tabset class="root-tabset bootstrap">

<tab heading="Basic info">
<tab i18n-heading heading="Basic info">
<div class="col-md-8">
<div class="form-group">
<label i18n for="name">Title</label>
Expand Down Expand Up @@ -112,7 +112,7 @@
</div>
</tab>

<tab heading="Advanced settings">
<tab i18n-heading heading="Advanced settings">
<div class="col-md-12 advanced-settings">
<div class="form-group">
<my-video-image
Expand Down
107 changes: 107 additions & 0 deletions client/src/locale/source/messages_en_US.xml
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,12 @@
<context context-type="sourcefile">app/+admin/config/edit-custom-config/edit-custom-config.component.ts</context>
<context context-type="linenumber">122</context>
</context-group>
</trans-unit><trans-unit id="50247a2f9711ea9e9a85aacc46668131e9b424a5" datatype="html">
<source>Basic configuration</source>
<context-group purpose="location">
<context context-type="sourcefile">app/+admin/config/edit-custom-config/edit-custom-config.component.ts</context>
<context context-type="linenumber">5</context>
</context-group>
</trans-unit><trans-unit id="99cb827741e93125476a0f5b676372d85d15b5fc" datatype="html">
<source>Twitter</source>
<context-group purpose="location">
Expand Down Expand Up @@ -709,6 +715,12 @@ Check this checkbox, save the configuration and test with a video URL of your in
<context context-type="sourcefile">app/+admin/config/edit-custom-config/edit-custom-config.component.ts</context>
<context context-type="linenumber">162</context>
</context-group>
</trans-unit><trans-unit id="419d940613972cc3fae9c8ea0a4306dbf80616e5" datatype="html">
<source>Services</source>
<context-group purpose="location">
<context context-type="sourcefile">app/+admin/config/edit-custom-config/edit-custom-config.component.ts</context>
<context context-type="linenumber">136</context>
</context-group>
</trans-unit><trans-unit id="fe22d2c0020e913ee4b75ec22a3abc8814810490" datatype="html">
<source>Transcoding</source>
<context-group purpose="location">
Expand Down Expand Up @@ -789,6 +801,12 @@ Check this checkbox, save the configuration and test with a video URL of your in
<context context-type="sourcefile">app/+admin/config/edit-custom-config/edit-custom-config.component.ts</context>
<context context-type="linenumber">247</context>
</context-group>
</trans-unit><trans-unit id="6c44844ebdb7352c433b7734feaa65f01bb594ab" datatype="html">
<source>Advanced configuration</source>
<context-group purpose="location">
<context context-type="sourcefile">app/+admin/config/edit-custom-config/edit-custom-config.component.ts</context>
<context context-type="linenumber">170</context>
</context-group>
</trans-unit><trans-unit id="dad5a5283e4c853c011a0f03d5a52310338bbff8" datatype="html">
<source>Update configuration</source>
<context-group purpose="location">
Expand Down Expand Up @@ -1440,6 +1458,12 @@ When you will upload a video in this channel, the video support field will be au
<context context-type="sourcefile">app/videos/+video-edit/shared/video-edit.component.ts</context>
<context context-type="linenumber">109</context>
</context-group>
</trans-unit><trans-unit id="c7742322b1d3dbc921362058d1747c7ec2adbec7" datatype="html">
<source>Basic info</source>
<context-group purpose="location">
<context context-type="sourcefile">app/videos/+video-edit/shared/video-edit.component.ts</context>
<context context-type="linenumber">4</context>
</context-group>
</trans-unit><trans-unit id="1dd793abd1cb8d16a7a2cb71ca5549a7111ee513" datatype="html">
<source>Upload thumbnail</source>
<context-group purpose="location">
Expand Down Expand Up @@ -1472,6 +1496,12 @@ When you will upload a video in this channel, the video support field will be au
<context context-type="sourcefile">app/videos/+video-edit/shared/video-edit.component.ts</context>
<context context-type="linenumber">133</context>
</context-group>
</trans-unit><trans-unit id="d91da0abc638c05e52adea253d0813f3584da4b1" datatype="html">
<source>Advanced settings</source>
<context-group purpose="location">
<context context-type="sourcefile">app/videos/+video-edit/shared/video-edit.component.ts</context>
<context context-type="linenumber">115</context>
</context-group>
</trans-unit><trans-unit id="c07377d8b52fde03fcf70824a980346b9222d056" datatype="html">
<source>(extensions: &lt;x id="INTERPOLATION" equiv-text="{{ videoImageExtensions }}"/&gt;, max size: &lt;x id="INTERPOLATION_1" equiv-text="{{ maxVideoImageSize | bytes }}"/&gt;)</source>
<context-group purpose="location">
Expand Down Expand Up @@ -2209,6 +2239,27 @@ When you will upload a video in this channel, the video support field will be au
<context context-type="linenumber">1</context>
</context-group>
</trans-unit>
<trans-unit id="f995df052a1dfc675c2a21926420a707d9601936" datatype="html">
<source>Following</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/follows/follows.component.ts</context>
<context context-type="linenumber">1</context>
</context-group>
</trans-unit>
<trans-unit id="d29764bcbaad3ef69b6be92be35bdf25972ce246" datatype="html">
<source>Follow</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/follows/follows.component.ts</context>
<context context-type="linenumber">1</context>
</context-group>
</trans-unit>
<trans-unit id="9bee670725966ed477b4c33a545c8b5436b0065e" datatype="html">
<source>Followers</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/follows/follows.component.ts</context>
<context context-type="linenumber">1</context>
</context-group>
</trans-unit>
<trans-unit id="364463fab6c5714118d6449561a0f8de1cc10bfa" datatype="html">
<source>User &lt;x id="INTERPOLATION" equiv-text="{{username}}"/&gt; created.</source>
<context-group purpose="location">
Expand Down Expand Up @@ -2878,6 +2929,48 @@ When you will upload a video in this channel, the video support field will be au
<context context-type="linenumber">1</context>
</context-group>
</trans-unit>
<trans-unit id="457f161d3ca706b8de263b0cd58e493d54e7d4c5" datatype="html">
<source>&lt;x id="START_LINK" ctype="x-a" equiv-text="&lt;a&gt;"/&gt;Markdown&lt;x id="CLOSE_LINK" ctype="x-a" equiv-text="&lt;/a&gt;"/&gt; compatible that supports:</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/misc/help.component.ts</context>
<context context-type="linenumber">1</context>
</context-group>
</trans-unit>
<trans-unit id="ab4426b60f13c00b61d6b714d390dc629f314980" datatype="html">
<source>Emphasis</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/misc/help.component.ts</context>
<context context-type="linenumber">1</context>
</context-group>
</trans-unit>
<trans-unit id="dc60677d5a906e69f38a5cf9da7f2eb03931bea0" datatype="html">
<source>Links</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/misc/help.component.ts</context>
<context context-type="linenumber">1</context>
</context-group>
</trans-unit>
<trans-unit id="80220239e07f36ea8d5f10118dc52ce4b13bc15a" datatype="html">
<source>New lines</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/misc/help.component.ts</context>
<context context-type="linenumber">1</context>
</context-group>
</trans-unit>
<trans-unit id="b15e7bec5c7833d2d9634946ccbed68967b1bee1" datatype="html">
<source>Lists</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/misc/help.component.ts</context>
<context context-type="linenumber">1</context>
</context-group>
</trans-unit>
<trans-unit id="b73f7f5060fb22a1e9ec462b1bb02493fa3ab866" datatype="html">
<source>Images</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/misc/help.component.ts</context>
<context context-type="linenumber">1</context>
</context-group>
</trans-unit>
<trans-unit id="0c0f5bbcd2386018ec057877f9d3c5c2c9880cac" datatype="html">
<source>Request is too large for the server. Please contact you administrator if you want to increase the limit size.</source>
<context-group purpose="location">
Expand Down Expand Up @@ -2913,6 +3006,20 @@ When you will upload a video in this channel, the video support field will be au
<context context-type="linenumber">1</context>
</context-group>
</trans-unit>
<trans-unit id="7296e9f7cc4956b6d57c541728b0826e76d108ba" datatype="html">
<source>~ &lt;x id="INTERPOLATION" equiv-text="{{minutes}}"/&gt; &lt;x id="ICU" equiv-text="{minutes, plural, =1 {...} other {...}}"/&gt;</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/signup/signup.component.ts</context>
<context context-type="linenumber">1</context>
</context-group>
</trans-unit>
<trans-unit id="cf9ddbb55b25178660e09346209aedc10108aa24" datatype="html">
<source>{VAR_PLURAL, plural, =1 {minute} other {minutes} }</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/signup/signup.component.ts</context>
<context context-type="linenumber">1</context>
</context-group>
</trans-unit>
<trans-unit id="10ffa5c3dbcee491d66f80d8d4dce3e119a6ec86" datatype="html">
<source>&lt;x id="INTERPOLATION" equiv-text="{{seconds}}"/&gt; of full HD videos</source>
<context-group purpose="location">
Expand Down
Loading

0 comments on commit 0975cd5

Please sign in to comment.