aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+my-account')
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.html8
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts8
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.html6
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts6
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-settings.component.html14
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-settings.component.ts10
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html17
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts8
-rw-r--r--client/src/app/+my-account/my-account-video-channels/my-account-video-channel-create.component.ts11
-rw-r--r--client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.component.html10
-rw-r--r--client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts11
-rw-r--r--client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.html6
-rw-r--r--client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts20
-rw-r--r--client/src/app/+my-account/my-account-videos/my-account-videos.component.html8
-rw-r--r--client/src/app/+my-account/my-account-videos/my-account-videos.component.ts22
-rw-r--r--client/src/app/+my-account/my-account.component.html6
16 files changed, 103 insertions, 68 deletions
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.html b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.html
index b0e3cada4..767ef0336 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.html
+++ b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.html
@@ -2,9 +2,9 @@
2 2
3<form role="form" (ngSubmit)="changePassword()" [formGroup]="form"> 3<form role="form" (ngSubmit)="changePassword()" [formGroup]="form">
4 4
5 <label for="new-password">Change password</label> 5 <label i18n for="new-password">Change password</label>
6 <input 6 <input
7 type="password" id="new-password" placeholder="New password" 7 type="password" id="new-password" i18n-placeholder placeholder="New password"
8 formControlName="new-password" [ngClass]="{ 'input-error': formErrors['new-password'] }" 8 formControlName="new-password" [ngClass]="{ 'input-error': formErrors['new-password'] }"
9 > 9 >
10 <div *ngIf="formErrors['new-password']" class="form-error"> 10 <div *ngIf="formErrors['new-password']" class="form-error">
@@ -12,9 +12,9 @@
12 </div> 12 </div>
13 13
14 <input 14 <input
15 type="password" id="new-confirmed-password" placeholder="Confirm new password" 15 type="password" id="new-confirmed-password" i18n-placeholder placeholder="Confirm new password"
16 formControlName="new-confirmed-password" 16 formControlName="new-confirmed-password"
17 > 17 >
18 18
19 <input type="submit" value="Change password" [disabled]="!form.valid"> 19 <input type="submit" i18n-value value="Change password" [disabled]="!form.valid">
20</form> 20</form>
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts
index 80af668f9..1a88aa82e 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'
2import { FormBuilder, FormGroup } from '@angular/forms' 2import { FormBuilder, FormGroup } from '@angular/forms'
3import { NotificationsService } from 'angular2-notifications' 3import { NotificationsService } from 'angular2-notifications'
4import { FormReactive, USER_PASSWORD, UserService } from '../../../shared' 4import { FormReactive, USER_PASSWORD, UserService } from '../../../shared'
5import { I18n } from '@ngx-translate/i18n-polyfill'
5 6
6@Component({ 7@Component({
7 selector: 'my-account-change-password', 8 selector: 'my-account-change-password',
@@ -24,7 +25,8 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On
24 constructor ( 25 constructor (
25 private formBuilder: FormBuilder, 26 private formBuilder: FormBuilder,
26 private notificationsService: NotificationsService, 27 private notificationsService: NotificationsService,
27 private userService: UserService 28 private userService: UserService,
29 private i18n: I18n
28 ) { 30 ) {
29 super() 31 super()
30 } 32 }
@@ -49,12 +51,12 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On
49 this.error = null 51 this.error = null
50 52
51 if (newPassword !== newConfirmedPassword) { 53 if (newPassword !== newConfirmedPassword) {
52 this.error = 'The new password and the confirmed password do not correspond.' 54 this.error = this.i18n('The new password and the confirmed password do not correspond.')
53 return 55 return
54 } 56 }
55 57
56 this.userService.changePassword(newPassword).subscribe( 58 this.userService.changePassword(newPassword).subscribe(
57 () => this.notificationsService.success('Success', 'Password updated.'), 59 () => this.notificationsService.success(this.i18n('Success'), this.i18n('Password updated.')),
58 60
59 err => this.error = err.message 61 err => this.error = err.message
60 ) 62 )
diff --git a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.html b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.html
index 306f3a12c..bbdce5b02 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.html
+++ b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.html
@@ -2,7 +2,7 @@
2 2
3<form role="form" (ngSubmit)="updateMyProfile()" [formGroup]="form"> 3<form role="form" (ngSubmit)="updateMyProfile()" [formGroup]="form">
4 4
5 <label for="display-name">Display name</label> 5 <label i18n for="display-name">Display name</label>
6 <input 6 <input
7 type="text" id="display-name" 7 type="text" id="display-name"
8 formControlName="display-name" [ngClass]="{ 'input-error': formErrors['display-name'] }" 8 formControlName="display-name" [ngClass]="{ 'input-error': formErrors['display-name'] }"
@@ -11,7 +11,7 @@
11 {{ formErrors['display-name'] }} 11 {{ formErrors['display-name'] }}
12 </div> 12 </div>
13 13
14 <label for="description">Description</label> 14 <label i18n for="description">Description</label>
15 <textarea 15 <textarea
16 id="description" formControlName="description" 16 id="description" formControlName="description"
17 [ngClass]="{ 'input-error': formErrors['description'] }" 17 [ngClass]="{ 'input-error': formErrors['description'] }"
@@ -20,5 +20,5 @@
20 {{ formErrors.description }} 20 {{ formErrors.description }}
21 </div> 21 </div>
22 22
23 <input type="submit" value="Update my profile" [disabled]="!form.valid"> 23 <input type="submit" i18n-value value="Update my profile" [disabled]="!form.valid">
24</form> 24</form>
diff --git a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts
index 468be022c..35843ecd9 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts
@@ -3,6 +3,7 @@ import { FormBuilder, FormGroup } from '@angular/forms'
3import { NotificationsService } from 'angular2-notifications' 3import { NotificationsService } from 'angular2-notifications'
4import { FormReactive, USER_DESCRIPTION, USER_DISPLAY_NAME, UserService } from '../../../shared' 4import { FormReactive, USER_DESCRIPTION, USER_DISPLAY_NAME, UserService } from '../../../shared'
5import { User } from '@app/shared' 5import { User } from '@app/shared'
6import { I18n } from '@ngx-translate/i18n-polyfill'
6 7
7@Component({ 8@Component({
8 selector: 'my-account-profile', 9 selector: 'my-account-profile',
@@ -27,7 +28,8 @@ export class MyAccountProfileComponent extends FormReactive implements OnInit {
27 constructor ( 28 constructor (
28 private formBuilder: FormBuilder, 29 private formBuilder: FormBuilder,
29 private notificationsService: NotificationsService, 30 private notificationsService: NotificationsService,
30 private userService: UserService 31 private userService: UserService,
32 private i18n: I18n
31 ) { 33 ) {
32 super() 34 super()
33 } 35 }
@@ -56,7 +58,7 @@ export class MyAccountProfileComponent extends FormReactive implements OnInit {
56 this.user.account.displayName = displayName 58 this.user.account.displayName = displayName
57 this.user.account.description = description 59 this.user.account.description = description
58 60
59 this.notificationsService.success('Success', 'Profile updated.') 61 this.notificationsService.success(this.i18n('Success'), this.i18n('Profile updated.'))
60 }, 62 },
61 63
62 err => this.error = err.message 64 err => this.error = err.message
diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.html b/client/src/app/+my-account/my-account-settings/my-account-settings.component.html
index 0fcc7782e..056c2a7d7 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.html
+++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.html
@@ -6,27 +6,27 @@
6 <div class="user-info-display-name">{{ user.account.displayName }}</div> 6 <div class="user-info-display-name">{{ user.account.displayName }}</div>
7 <div class="user-info-username">{{ user.username }}</div> 7 <div class="user-info-username">{{ user.username }}</div>
8 </div> 8 </div>
9 <div class="user-info-followers">{{ user.account?.followersCount }} subscribers</div> 9 <div i18n class="user-info-followers">{{ user.account?.followersCount }} subscribers</div>
10 </div> 10 </div>
11</div> 11</div>
12 12
13<div class="button-file"> 13<div class="button-file">
14 <span>Change your avatar</span> 14 <span i18n>Change your avatar</span>
15 <input #avatarfileInput type="file" name="avatarfile" id="avatarfile" [accept]="avatarExtensions" (change)="changeAvatar()" /> 15 <input #avatarfileInput type="file" name="avatarfile" id="avatarfile" [accept]="avatarExtensions" (change)="changeAvatar()" />
16</div> 16</div>
17<div class="file-max-size">(extensions: {{ avatarExtensions }}, max size: {{ maxAvatarSize | bytes }})</div> 17<div i18n class="file-max-size">(extensions: {{ avatarExtensions }}, max size: {{ maxAvatarSize | bytes }})</div>
18 18
19<div class="user-quota"> 19<div class="user-quota">
20 <span class="user-quota-label">Video quota:</span> {{ userVideoQuotaUsed | bytes: 0 }} / {{ userVideoQuota }} 20 <span i18n class="user-quota-label">Video quota:</span> {{ userVideoQuotaUsed | bytes: 0 }} / {{ userVideoQuota }}
21</div> 21</div>
22 22
23<ng-template [ngIf]="user && user.account"> 23<ng-template [ngIf]="user && user.account">
24 <div class="account-title">Profile</div> 24 <div i18n class="account-title">Profile</div>
25 <my-account-profile [user]="user"></my-account-profile> 25 <my-account-profile [user]="user"></my-account-profile>
26</ng-template> 26</ng-template>
27 27
28<div class="account-title">Password</div> 28<div i18n class="account-title">Password</div>
29<my-account-change-password></my-account-change-password> 29<my-account-change-password></my-account-change-password>
30 30
31<div class="account-title">Video settings</div> 31<div i18n class="account-title">Video settings</div>
32<my-account-video-settings [user]="user"></my-account-video-settings> 32<my-account-video-settings [user]="user"></my-account-video-settings>
diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts
index 06d1138e7..44eddaa7c 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts
@@ -5,6 +5,7 @@ import { AuthService } from '../../core'
5import { ServerService } from '../../core/server' 5import { ServerService } from '../../core/server'
6import { User } from '../../shared' 6import { User } from '../../shared'
7import { UserService } from '../../shared/users' 7import { UserService } from '../../shared/users'
8import { I18n } from '@ngx-translate/i18n-polyfill'
8 9
9@Component({ 10@Component({
10 selector: 'my-account-settings', 11 selector: 'my-account-settings',
@@ -22,7 +23,8 @@ export class MyAccountSettingsComponent implements OnInit {
22 private userService: UserService, 23 private userService: UserService,
23 private authService: AuthService, 24 private authService: AuthService,
24 private serverService: ServerService, 25 private serverService: ServerService,
25 private notificationsService: NotificationsService 26 private notificationsService: NotificationsService,
27 private i18n: I18n
26 ) {} 28 ) {}
27 29
28 ngOnInit () { 30 ngOnInit () {
@@ -33,7 +35,7 @@ export class MyAccountSettingsComponent implements OnInit {
33 if (this.user.videoQuota !== -1) { 35 if (this.user.videoQuota !== -1) {
34 this.userVideoQuota = new BytesPipe().transform(this.user.videoQuota, 0).toString() 36 this.userVideoQuota = new BytesPipe().transform(this.user.videoQuota, 0).toString()
35 } else { 37 } else {
36 this.userVideoQuota = 'Unlimited' 38 this.userVideoQuota = this.i18n('Unlimited')
37 } 39 }
38 } 40 }
39 ) 41 )
@@ -51,12 +53,12 @@ export class MyAccountSettingsComponent implements OnInit {
51 this.userService.changeAvatar(formData) 53 this.userService.changeAvatar(formData)
52 .subscribe( 54 .subscribe(
53 data => { 55 data => {
54 this.notificationsService.success('Success', 'Avatar changed.') 56 this.notificationsService.success(this.i18n('Success'), this.i18n('Avatar changed.'))
55 57
56 this.user.account.avatar = data.avatar 58 this.user.account.avatar = data.avatar
57 }, 59 },
58 60
59 err => this.notificationsService.error('Error', err.message) 61 err => this.notificationsService.error(this.i18n('Error'), err.message)
60 ) 62 )
61 } 63 }
62 64
diff --git a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html b/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html
index 0e8598e9e..98587eb18 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html
+++ b/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html
@@ -1,13 +1,16 @@
1<form role="form" (ngSubmit)="updateDetails()" [formGroup]="form"> 1<form role="form" (ngSubmit)="updateDetails()" [formGroup]="form">
2 <div class="form-group"> 2 <div class="form-group">
3 <label for="nsfwPolicy">Default policy on videos containing sensitive content</label> 3 <label i18n for="nsfwPolicy">Default policy on videos containing sensitive content</label>
4 <my-help helpType="custom" customHtml="With <strong>Do not list</strong> or <strong>Blur thumbnails</strong>, a confirmation will be requested to watch the video."></my-help> 4 <my-help
5 helpType="custom" i18n-customHtml
6 customHtml="With <strong>Do not list</strong> or <strong>Blur thumbnails</strong>, a confirmation will be requested to watch the video."
7 ></my-help>
5 8
6 <div class="peertube-select-container"> 9 <div class="peertube-select-container">
7 <select id="nsfwPolicy" formControlName="nsfwPolicy"> 10 <select id="nsfwPolicy" formControlName="nsfwPolicy">
8 <option value="do_not_list">Do not list</option> 11 <option i18n value="do_not_list">Do not list</option>
9 <option value="blur">Blur thumbnails</option> 12 <option i18n value="blur">Blur thumbnails</option>
10 <option value="display">Display</option> 13 <option i18n value="display">Display</option>
11 </select> 14 </select>
12 </div> 15 </div>
13 </div> 16 </div>
@@ -18,8 +21,8 @@
18 formControlName="autoPlayVideo" 21 formControlName="autoPlayVideo"
19 > 22 >
20 <label for="autoPlayVideo"></label> 23 <label for="autoPlayVideo"></label>
21 <label for="autoPlayVideo">Automatically plays video</label> 24 <label i18n for="autoPlayVideo">Automatically plays video</label>
22 </div> 25 </div>
23 26
24 <input type="submit" value="Save" [disabled]="!form.valid"> 27 <input type="submit" i18n-value value="Save" [disabled]="!form.valid">
25</form> 28</form>
diff --git a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts b/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts
index acc70c14d..4588f73db 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts
@@ -4,6 +4,7 @@ import { NotificationsService } from 'angular2-notifications'
4import { UserUpdateMe } from '../../../../../../shared' 4import { UserUpdateMe } from '../../../../../../shared'
5import { AuthService } from '../../../core' 5import { AuthService } from '../../../core'
6import { FormReactive, User, UserService } from '../../../shared' 6import { FormReactive, User, UserService } from '../../../shared'
7import { I18n } from '@ngx-translate/i18n-polyfill'
7 8
8@Component({ 9@Component({
9 selector: 'my-account-video-settings', 10 selector: 'my-account-video-settings',
@@ -21,7 +22,8 @@ export class MyAccountVideoSettingsComponent extends FormReactive implements OnI
21 private authService: AuthService, 22 private authService: AuthService,
22 private formBuilder: FormBuilder, 23 private formBuilder: FormBuilder,
23 private notificationsService: NotificationsService, 24 private notificationsService: NotificationsService,
24 private userService: UserService 25 private userService: UserService,
26 private i18n: I18n
25 ) { 27 ) {
26 super() 28 super()
27 } 29 }
@@ -49,12 +51,12 @@ export class MyAccountVideoSettingsComponent extends FormReactive implements OnI
49 51
50 this.userService.updateMyProfile(details).subscribe( 52 this.userService.updateMyProfile(details).subscribe(
51 () => { 53 () => {
52 this.notificationsService.success('Success', 'Information updated.') 54 this.notificationsService.success(this.i18n('Success'), this.i18n('Information updated.'))
53 55
54 this.authService.refreshUserInformation() 56 this.authService.refreshUserInformation()
55 }, 57 },
56 58
57 err => this.notificationsService.error('Error', err.message) 59 err => this.notificationsService.error(this.i18n('Error'), err.message)
58 ) 60 )
59 } 61 }
60} 62}
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-create.component.ts b/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-create.component.ts
index c82bb39c8..9b5a12d18 100644
--- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-create.component.ts
+++ b/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-create.component.ts
@@ -11,6 +11,7 @@ import {
11} from '@app/shared/forms/form-validators/video-channel' 11} from '@app/shared/forms/form-validators/video-channel'
12import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' 12import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
13import { AuthService } from '@app/core' 13import { AuthService } from '@app/core'
14import { I18n } from '@ngx-translate/i18n-polyfill'
14 15
15@Component({ 16@Component({
16 selector: 'my-account-video-channel-create', 17 selector: 'my-account-video-channel-create',
@@ -37,7 +38,8 @@ export class MyAccountVideoChannelCreateComponent extends MyAccountVideoChannelE
37 private notificationsService: NotificationsService, 38 private notificationsService: NotificationsService,
38 private router: Router, 39 private router: Router,
39 private formBuilder: FormBuilder, 40 private formBuilder: FormBuilder,
40 private videoChannelService: VideoChannelService 41 private videoChannelService: VideoChannelService,
42 private i18n: I18n
41 ) { 43 ) {
42 super() 44 super()
43 } 45 }
@@ -69,7 +71,10 @@ export class MyAccountVideoChannelCreateComponent extends MyAccountVideoChannelE
69 this.videoChannelService.createVideoChannel(videoChannelCreate).subscribe( 71 this.videoChannelService.createVideoChannel(videoChannelCreate).subscribe(
70 () => { 72 () => {
71 this.authService.refreshUserInformation() 73 this.authService.refreshUserInformation()
72 this.notificationsService.success('Success', `Video channel ${videoChannelCreate.displayName} created.`) 74 this.notificationsService.success(
75 this.i18n('Success'),
76 this.i18n('Video channel {{ videoChannelName }} created.', { videoChannelName: videoChannelCreate.displayName })
77 )
73 this.router.navigate([ '/my-account', 'video-channels' ]) 78 this.router.navigate([ '/my-account', 'video-channels' ])
74 }, 79 },
75 80
@@ -82,6 +87,6 @@ export class MyAccountVideoChannelCreateComponent extends MyAccountVideoChannelE
82 } 87 }
83 88
84 getFormButtonTitle () { 89 getFormButtonTitle () {
85 return 'Create' 90 return this.i18n('Create')
86 } 91 }
87} 92}
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.component.html b/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.component.html
index 10d408d55..1c08cfdca 100644
--- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.component.html
+++ b/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.component.html
@@ -1,11 +1,11 @@
1<div class="form-sub-title" *ngIf="isCreation() === true">Create a video channel</div> 1<div i18n class="form-sub-title" *ngIf="isCreation() === true">Create a video channel</div>
2<div class="form-sub-title" *ngIf="isCreation() === false">Update {{ videoChannel?.displayName }}</div> 2<div i18n class="form-sub-title" *ngIf="isCreation() === false">Update {{ videoChannel?.displayName }}</div>
3 3
4<div *ngIf="error" class="alert alert-danger">{{ error }}</div> 4<div *ngIf="error" class="alert alert-danger">{{ error }}</div>
5 5
6<form role="form" (ngSubmit)="formValidated()" [formGroup]="form"> 6<form role="form" (ngSubmit)="formValidated()" [formGroup]="form">
7 <div class="form-group"> 7 <div class="form-group">
8 <label for="display-name">Display name</label> 8 <label i18n for="display-name">Display name</label>
9 <input 9 <input
10 type="text" id="display-name" 10 type="text" id="display-name"
11 formControlName="display-name" [ngClass]="{ 'input-error': formErrors['display-name'] }" 11 formControlName="display-name" [ngClass]="{ 'input-error': formErrors['display-name'] }"
@@ -16,7 +16,7 @@
16 </div> 16 </div>
17 17
18 <div class="form-group"> 18 <div class="form-group">
19 <label for="description">Description</label> 19 <label i18n for="description">Description</label>
20 <textarea 20 <textarea
21 id="description" formControlName="description" 21 id="description" formControlName="description"
22 [ngClass]="{ 'input-error': formErrors['description'] }" 22 [ngClass]="{ 'input-error': formErrors['description'] }"
@@ -29,7 +29,7 @@
29 <div class="form-group"> 29 <div class="form-group">
30 <label for="support">Support</label> 30 <label for="support">Support</label>
31 <my-help 31 <my-help
32 helpType="markdownEnhanced" preHtml="Short text to tell people how they can support your channel (membership platform...).<br /><br /> 32 helpType="markdownEnhanced" i18n-preHtml preHtml="Short text to tell people how they can support your channel (membership platform...).<br /><br />
33When you will upload a video in this channel, the video support field will be automatically filled by this text." 33When you will upload a video in this channel, the video support field will be automatically filled by this text."
34 ></my-help> 34 ></my-help>
35 <my-markdown-textarea 35 <my-markdown-textarea
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts b/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts
index b4c8df3cd..78c578764 100644
--- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts
+++ b/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts
@@ -13,6 +13,7 @@ import { VideoChannelService } from '@app/shared/video-channel/video-channel.ser
13import { Subscription } from 'rxjs' 13import { Subscription } from 'rxjs'
14import { VideoChannel } from '@app/shared/video-channel/video-channel.model' 14import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
15import { AuthService } from '@app/core' 15import { AuthService } from '@app/core'
16import { I18n } from '@ngx-translate/i18n-polyfill'
16 17
17@Component({ 18@Component({
18 selector: 'my-account-video-channel-update', 19 selector: 'my-account-video-channel-update',
@@ -43,7 +44,8 @@ export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelE
43 private router: Router, 44 private router: Router,
44 private route: ActivatedRoute, 45 private route: ActivatedRoute,
45 private formBuilder: FormBuilder, 46 private formBuilder: FormBuilder,
46 private videoChannelService: VideoChannelService 47 private videoChannelService: VideoChannelService,
48 private i18n: I18n
47 ) { 49 ) {
48 super() 50 super()
49 } 51 }
@@ -97,7 +99,10 @@ export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelE
97 this.videoChannelService.updateVideoChannel(this.videoChannelToUpdate.uuid, videoChannelUpdate).subscribe( 99 this.videoChannelService.updateVideoChannel(this.videoChannelToUpdate.uuid, videoChannelUpdate).subscribe(
98 () => { 100 () => {
99 this.authService.refreshUserInformation() 101 this.authService.refreshUserInformation()
100 this.notificationsService.success('Success', `Video channel ${videoChannelUpdate.displayName} updated.`) 102 this.notificationsService.success(
103 this.i18n('Success'),
104 this.i18n('Video channel {{ videoChannelName }} updated.', { videoChannelName: videoChannelUpdate.displayName })
105 )
101 this.router.navigate([ '/my-account', 'video-channels' ]) 106 this.router.navigate([ '/my-account', 'video-channels' ])
102 }, 107 },
103 108
@@ -110,6 +115,6 @@ export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelE
110 } 115 }
111 116
112 getFormButtonTitle () { 117 getFormButtonTitle () {
113 return 'Update' 118 return this.i18n('Update')
114 } 119 }
115} 120}
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.html b/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.html
index 90c401bc5..d27c3b4ec 100644
--- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.html
+++ b/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.html
@@ -1,7 +1,7 @@
1<div class="video-channels-header"> 1<div class="video-channels-header">
2 <a class="create-button" routerLink="create"> 2 <a class="create-button" routerLink="create">
3 <span class="icon icon-add"></span> 3 <span class="icon icon-add"></span>
4 Create another video channel 4 <ng-container i18n>Create another video channel</ng-container>
5 </a> 5 </a>
6</div> 6</div>
7 7
@@ -12,13 +12,13 @@
12 </a> 12 </a>
13 13
14 <div class="video-channel-info"> 14 <div class="video-channel-info">
15 <a [routerLink]="[ '/video-channels', videoChannel.uuid ]" class="video-channel-names" title="Go to the channel"> 15 <a [routerLink]="[ '/video-channels', videoChannel.uuid ]" class="video-channel-names" i18n-title title="Go to the channel">
16 <div class="video-channel-display-name">{{ videoChannel.displayName }}</div> 16 <div class="video-channel-display-name">{{ videoChannel.displayName }}</div>
17 <!-- Hide the name for now, because it's an UUID not very friendly --> 17 <!-- Hide the name for now, because it's an UUID not very friendly -->
18 <!--<div class="video-channel-name">{{ videoChannel.name }}</div>--> 18 <!--<div class="video-channel-name">{{ videoChannel.name }}</div>-->
19 </a> 19 </a>
20 20
21 <div class="video-channel-followers">{{ videoChannel.followersCount }} subscribers</div> 21 <div i18n class="video-channel-followers">{{ videoChannel.followersCount }} subscribers</div>
22 </div> 22 </div>
23 23
24 <div class="video-channel-buttons"> 24 <div class="video-channel-buttons">
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts b/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts
index 20c8798d1..cff1041f6 100644
--- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts
+++ b/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts
@@ -6,6 +6,7 @@ import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
6import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' 6import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
7import { User } from '@app/shared' 7import { User } from '@app/shared'
8import { flatMap } from 'rxjs/operators' 8import { flatMap } from 'rxjs/operators'
9import { I18n } from '@ngx-translate/i18n-polyfill'
9 10
10@Component({ 11@Component({
11 selector: 'my-account-video-channels', 12 selector: 'my-account-video-channels',
@@ -21,7 +22,8 @@ export class MyAccountVideoChannelsComponent implements OnInit {
21 private authService: AuthService, 22 private authService: AuthService,
22 private notificationsService: NotificationsService, 23 private notificationsService: NotificationsService,
23 private confirmService: ConfirmService, 24 private confirmService: ConfirmService,
24 private videoChannelService: VideoChannelService 25 private videoChannelService: VideoChannelService,
26 private i18n: I18n
25 ) {} 27 ) {}
26 28
27 ngOnInit () { 29 ngOnInit () {
@@ -32,10 +34,13 @@ export class MyAccountVideoChannelsComponent implements OnInit {
32 34
33 async deleteVideoChannel (videoChannel: VideoChannel) { 35 async deleteVideoChannel (videoChannel: VideoChannel) {
34 const res = await this.confirmService.confirmWithInput( 36 const res = await this.confirmService.confirmWithInput(
35 `Do you really want to delete ${videoChannel.displayName}? It will delete all videos uploaded in this channel too.`, 37 this.i18n(
36 'Please type the name of the video channel to confirm', 38 'Do you really want to delete {{ videoChannelName }}? It will delete all videos uploaded in this channel too.',
39 { videoChannelName: videoChannel.displayName }
40 ),
41 this.i18n('Please type the name of the video channel to confirm'),
37 videoChannel.displayName, 42 videoChannel.displayName,
38 'Delete' 43 this.i18n('Delete')
39 ) 44 )
40 if (res === false) return 45 if (res === false) return
41 46
@@ -43,10 +48,13 @@ export class MyAccountVideoChannelsComponent implements OnInit {
43 .subscribe( 48 .subscribe(
44 status => { 49 status => {
45 this.loadVideoChannels() 50 this.loadVideoChannels()
46 this.notificationsService.success('Success', `Video channel ${videoChannel.name} deleted.`) 51 this.notificationsService.success(
52 this.i18n('Success'),
53 this.i18n('Video channel {{ videoChannelName } deleted.', { videoChannelName: videoChannel.displayName })
54 )
47 }, 55 },
48 56
49 error => this.notificationsService.error('Error', error.message) 57 error => this.notificationsService.error(this.i18n('Error'), error.message)
50 ) 58 )
51 } 59 }
52 60
diff --git a/client/src/app/+my-account/my-account-videos/my-account-videos.component.html b/client/src/app/+my-account/my-account-videos/my-account-videos.component.html
index a31cb0c3d..35a99d0b3 100644
--- a/client/src/app/+my-account/my-account-videos/my-account-videos.component.html
+++ b/client/src/app/+my-account/my-account-videos/my-account-videos.component.html
@@ -1,4 +1,4 @@
1<div *ngIf="pagination.totalItems === 0">No results.</div> 1<div i18n *ngIf="pagination.totalItems === 0">No results.</div>
2 2
3<div 3<div
4 myInfiniteScroller 4 myInfiniteScroller
@@ -17,18 +17,18 @@
17 17
18 <div class="video-info"> 18 <div class="video-info">
19 <a class="video-info-name" [routerLink]="['/videos/watch', video.uuid]" [attr.title]="video.name">{{ video.name }}</a> 19 <a class="video-info-name" [routerLink]="['/videos/watch', video.uuid]" [attr.title]="video.name">{{ video.name }}</a>
20 <span class="video-info-date-views">{{ video.createdAt | myFromNow }} - {{ video.views | myNumberFormatter }} views</span> 20 <span i18n class="video-info-date-views">{{ video.createdAt | myFromNow }} - {{ video.views | myNumberFormatter }} views</span>
21 <div class="video-info-private">{{ video.privacy.label }}</div> 21 <div class="video-info-private">{{ video.privacy.label }}</div>
22 </div> 22 </div>
23 23
24 <!-- Display only once --> 24 <!-- Display only once -->
25 <div class="action-selection-mode" *ngIf="isInSelectionMode() === true && i === 0 && j === 0"> 25 <div class="action-selection-mode" *ngIf="isInSelectionMode() === true && i === 0 && j === 0">
26 <div class="action-selection-mode-child"> 26 <div class="action-selection-mode-child">
27 <span class="action-button action-button-cancel-selection" (click)="abortSelectionMode()"> 27 <span i18n class="action-button action-button-cancel-selection" (click)="abortSelectionMode()">
28 Cancel 28 Cancel
29 </span> 29 </span>
30 30
31 <span class="action-button action-button-delete-selection" (click)="deleteSelectedVideos()"> 31 <span i18n class="action-button action-button-delete-selection" (click)="deleteSelectedVideos()">
32 <span class="icon icon-delete-white"></span> 32 <span class="icon icon-delete-white"></span>
33 Delete 33 Delete
34 </span> 34 </span>
diff --git a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts
index 6ab6c2aa5..eed4be01f 100644
--- a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts
+++ b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts
@@ -11,6 +11,7 @@ import { ConfirmService } from '../../core/confirm'
11import { AbstractVideoList } from '../../shared/video/abstract-video-list' 11import { AbstractVideoList } from '../../shared/video/abstract-video-list'
12import { Video } from '../../shared/video/video.model' 12import { Video } from '../../shared/video/video.model'
13import { VideoService } from '../../shared/video/video.service' 13import { VideoService } from '../../shared/video/video.service'
14import { I18n } from '@ngx-translate/i18n-polyfill'
14 15
15@Component({ 16@Component({
16 selector: 'my-account-videos', 17 selector: 'my-account-videos',
@@ -18,7 +19,7 @@ import { VideoService } from '../../shared/video/video.service'
18 styleUrls: [ './my-account-videos.component.scss' ] 19 styleUrls: [ './my-account-videos.component.scss' ]
19}) 20})
20export class MyAccountVideosComponent extends AbstractVideoList implements OnInit, OnDestroy { 21export class MyAccountVideosComponent extends AbstractVideoList implements OnInit, OnDestroy {
21 titlePage = 'My videos' 22 titlePage: string
22 currentRoute = '/my-account/videos' 23 currentRoute = '/my-account/videos'
23 checkedVideos: { [ id: number ]: boolean } = {} 24 checkedVideos: { [ id: number ]: boolean } = {}
24 pagination: ComponentPagination = { 25 pagination: ComponentPagination = {
@@ -30,14 +31,19 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni
30 protected baseVideoWidth = -1 31 protected baseVideoWidth = -1
31 protected baseVideoHeight = 155 32 protected baseVideoHeight = 155
32 33
33 constructor (protected router: Router, 34 constructor (
34 protected route: ActivatedRoute, 35 protected router: Router,
35 protected authService: AuthService, 36 protected route: ActivatedRoute,
36 protected notificationsService: NotificationsService, 37 protected authService: AuthService,
37 protected confirmService: ConfirmService, 38 protected notificationsService: NotificationsService,
38 protected location: Location, 39 protected confirmService: ConfirmService,
39 private videoService: VideoService) { 40 protected location: Location,
41 protected i18n: I18n,
42 private videoService: VideoService
43 ) {
40 super() 44 super()
45
46 this.titlePage = this.i18n('My videos')
41 } 47 }
42 48
43 ngOnInit () { 49 ngOnInit () {
diff --git a/client/src/app/+my-account/my-account.component.html b/client/src/app/+my-account/my-account.component.html
index 591d58cf9..48db55ad3 100644
--- a/client/src/app/+my-account/my-account.component.html
+++ b/client/src/app/+my-account/my-account.component.html
@@ -1,10 +1,10 @@
1<div class="row"> 1<div class="row">
2 <div class="sub-menu"> 2 <div class="sub-menu">
3 <a routerLink="/my-account/settings" routerLinkActive="active" class="title-page">My settings</a> 3 <a i18n routerLink="/my-account/settings" routerLinkActive="active" class="title-page">My settings</a>
4 4
5 <a routerLink="/my-account/video-channels" routerLinkActive="active" class="title-page">My video channels</a> 5 <a i18n routerLink="/my-account/video-channels" routerLinkActive="active" class="title-page">My video channels</a>
6 6
7 <a routerLink="/my-account/videos" routerLinkActive="active" class="title-page">My videos</a> 7 <a i18n routerLink="/my-account/videos" routerLinkActive="active" class="title-page">My videos</a>
8 </div> 8 </div>
9 9
10 <div class="margin-content"> 10 <div class="margin-content">