diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-04 16:21:17 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-05 08:43:01 +0200 |
commit | b1d40cff89f7cff565a98cdbcea9a624196a169a (patch) | |
tree | d24746c1cc69f50471a9eba0dfb1c1bae06a1870 /client/src/app/+my-account/my-account-video-channels | |
parent | 989e526abf0c0dd7958deb630df009608561bb67 (diff) | |
download | PeerTube-b1d40cff89f7cff565a98cdbcea9a624196a169a.tar.gz PeerTube-b1d40cff89f7cff565a98cdbcea9a624196a169a.tar.zst PeerTube-b1d40cff89f7cff565a98cdbcea9a624196a169a.zip |
Add i18n attributes
Diffstat (limited to 'client/src/app/+my-account/my-account-video-channels')
5 files changed, 38 insertions, 20 deletions
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' |
12 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | 12 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' |
13 | import { AuthService } from '@app/core' | 13 | import { AuthService } from '@app/core' |
14 | import { 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 /> |
33 | When you will upload a video in this channel, the video support field will be automatically filled by this text." | 33 | When 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 | |||
13 | import { Subscription } from 'rxjs' | 13 | import { Subscription } from 'rxjs' |
14 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | 14 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' |
15 | import { AuthService } from '@app/core' | 15 | import { AuthService } from '@app/core' |
16 | import { 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' | |||
6 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | 6 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' |
7 | import { User } from '@app/shared' | 7 | import { User } from '@app/shared' |
8 | import { flatMap } from 'rxjs/operators' | 8 | import { flatMap } from 'rxjs/operators' |
9 | import { 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 | ||