diff options
Diffstat (limited to 'client/src/app/videos')
21 files changed, 126 insertions, 104 deletions
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 7e1be4467..bd9f69362 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 | |||
@@ -4,7 +4,7 @@ | |||
4 | <tab heading="Basic info"> | 4 | <tab heading="Basic info"> |
5 | <div class="col-md-8"> | 5 | <div class="col-md-8"> |
6 | <div class="form-group"> | 6 | <div class="form-group"> |
7 | <label for="name">Title</label> | 7 | <label i18n for="name">Title</label> |
8 | <input type="text" id="name" formControlName="name" /> | 8 | <input type="text" id="name" formControlName="name" /> |
9 | <div *ngIf="formErrors.name" class="form-error"> | 9 | <div *ngIf="formErrors.name" class="form-error"> |
10 | {{ formErrors.name }} | 10 | {{ formErrors.name }} |
@@ -12,7 +12,7 @@ | |||
12 | </div> | 12 | </div> |
13 | 13 | ||
14 | <div class="form-group"> | 14 | <div class="form-group"> |
15 | <label class="label-tags">Tags</label> <span>(press Enter to add)</span> | 15 | <label i18n class="label-tags">Tags</label> <span i18n>(press Enter to add)</span> |
16 | <tag-input | 16 | <tag-input |
17 | [validators]="tagValidators" [errorMessages]="tagValidatorsMessages" | 17 | [validators]="tagValidators" [errorMessages]="tagValidatorsMessages" |
18 | formControlName="tags" maxItems="5" modelAsStrings="true" | 18 | formControlName="tags" maxItems="5" modelAsStrings="true" |
@@ -20,8 +20,8 @@ | |||
20 | </div> | 20 | </div> |
21 | 21 | ||
22 | <div class="form-group"> | 22 | <div class="form-group"> |
23 | <label for="description">Description</label> | 23 | <label i18n for="description">Description</label> |
24 | <my-help helpType="markdownText" preHtml="Video descriptions are truncated by default and require manual action to expand them."></my-help> | 24 | <my-help helpType="markdownText" i18n-preHtml preHtml="Video descriptions are truncated by default and require manual action to expand them."></my-help> |
25 | <my-markdown-textarea truncate="250" formControlName="description"></my-markdown-textarea> | 25 | <my-markdown-textarea truncate="250" formControlName="description"></my-markdown-textarea> |
26 | 26 | ||
27 | <div *ngIf="formErrors.description" class="form-error"> | 27 | <div *ngIf="formErrors.description" class="form-error"> |
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | <div class="col-md-4"> | 33 | <div class="col-md-4"> |
34 | <div class="form-group"> | 34 | <div class="form-group"> |
35 | <label>Channel</label> | 35 | <label i18n>Channel</label> |
36 | <div class="peertube-select-container"> | 36 | <div class="peertube-select-container"> |
37 | <select formControlName="channelId"> | 37 | <select formControlName="channelId"> |
38 | <option *ngFor="let channel of userVideoChannels" [value]="channel.id">{{ channel.label }}</option> | 38 | <option *ngFor="let channel of userVideoChannels" [value]="channel.id">{{ channel.label }}</option> |
@@ -41,7 +41,7 @@ | |||
41 | </div> | 41 | </div> |
42 | 42 | ||
43 | <div class="form-group"> | 43 | <div class="form-group"> |
44 | <label for="category">Category</label> | 44 | <label i18n for="category">Category</label> |
45 | <div class="peertube-select-container"> | 45 | <div class="peertube-select-container"> |
46 | <select id="category" formControlName="category"> | 46 | <select id="category" formControlName="category"> |
47 | <option></option> | 47 | <option></option> |
@@ -55,7 +55,7 @@ | |||
55 | </div> | 55 | </div> |
56 | 56 | ||
57 | <div class="form-group"> | 57 | <div class="form-group"> |
58 | <label for="licence">Licence</label> | 58 | <label i18n for="licence">Licence</label> |
59 | <div class="peertube-select-container"> | 59 | <div class="peertube-select-container"> |
60 | <select id="licence" formControlName="licence"> | 60 | <select id="licence" formControlName="licence"> |
61 | <option></option> | 61 | <option></option> |
@@ -69,7 +69,7 @@ | |||
69 | </div> | 69 | </div> |
70 | 70 | ||
71 | <div class="form-group"> | 71 | <div class="form-group"> |
72 | <label for="language">Language</label> | 72 | <label i18n for="language">Language</label> |
73 | <div class="peertube-select-container"> | 73 | <div class="peertube-select-container"> |
74 | <select id="language" formControlName="language"> | 74 | <select id="language" formControlName="language"> |
75 | <option></option> | 75 | <option></option> |
@@ -83,7 +83,7 @@ | |||
83 | </div> | 83 | </div> |
84 | 84 | ||
85 | <div class="form-group"> | 85 | <div class="form-group"> |
86 | <label for="privacy">Privacy</label> | 86 | <label i18n for="privacy">Privacy</label> |
87 | <div class="peertube-select-container"> | 87 | <div class="peertube-select-container"> |
88 | <select id="privacy" formControlName="privacy"> | 88 | <select id="privacy" formControlName="privacy"> |
89 | <option></option> | 89 | <option></option> |
@@ -99,14 +99,14 @@ | |||
99 | <div class="form-group form-group-checkbox"> | 99 | <div class="form-group form-group-checkbox"> |
100 | <input type="checkbox" id="nsfw" formControlName="nsfw" /> | 100 | <input type="checkbox" id="nsfw" formControlName="nsfw" /> |
101 | <label for="nsfw"></label> | 101 | <label for="nsfw"></label> |
102 | <label for="nsfw">This video contains mature or explicit content</label> | 102 | <label i18n for="nsfw">This video contains mature or explicit content</label> |
103 | <my-help tooltipPlacement="top" helpType="custom" customHtml="Some instances do not list NSFW videos by default."></my-help> | 103 | <my-help tooltipPlacement="top" helpType="custom" i18n-customHtml customHtml="Some instances do not list NSFW videos by default."></my-help> |
104 | </div> | 104 | </div> |
105 | 105 | ||
106 | <div class="form-group form-group-checkbox"> | 106 | <div class="form-group form-group-checkbox"> |
107 | <input type="checkbox" id="commentsEnabled" formControlName="commentsEnabled" /> | 107 | <input type="checkbox" id="commentsEnabled" formControlName="commentsEnabled" /> |
108 | <label for="commentsEnabled"></label> | 108 | <label for="commentsEnabled"></label> |
109 | <label for="commentsEnabled">Enable video comments</label> | 109 | <label i18n for="commentsEnabled">Enable video comments</label> |
110 | </div> | 110 | </div> |
111 | 111 | ||
112 | </div> | 112 | </div> |
@@ -116,24 +116,24 @@ | |||
116 | <div class="col-md-12 advanced-settings"> | 116 | <div class="col-md-12 advanced-settings"> |
117 | <div class="form-group"> | 117 | <div class="form-group"> |
118 | <my-video-image | 118 | <my-video-image |
119 | inputLabel="Upload thumbnail" inputName="thumbnailfile" formControlName="thumbnailfile" | 119 | i18n-inputLabel inputLabel="Upload thumbnail" inputName="thumbnailfile" formControlName="thumbnailfile" |
120 | previewWidth="200px" previewHeight="110px" | 120 | previewWidth="200px" previewHeight="110px" |
121 | ></my-video-image> | 121 | ></my-video-image> |
122 | </div> | 122 | </div> |
123 | 123 | ||
124 | <div class="form-group"> | 124 | <div class="form-group"> |
125 | <my-video-image | 125 | <my-video-image |
126 | inputLabel="Upload preview" inputName="previewfile" formControlName="previewfile" | 126 | i18n-inputLabel inputLabel="Upload preview" inputName="previewfile" formControlName="previewfile" |
127 | previewWidth="360px" previewHeight="200px" | 127 | previewWidth="360px" previewHeight="200px" |
128 | ></my-video-image> | 128 | ></my-video-image> |
129 | </div> | 129 | </div> |
130 | 130 | ||
131 | <div class="form-group"> | 131 | <div class="form-group"> |
132 | <label for="support">Support</label> | 132 | <label i18n for="support">Support</label> |
133 | <my-help helpType="markdownEnhanced" preHtml="Short text to tell people how they can support you (membership platform...)."></my-help> | 133 | <my-help helpType="markdownEnhanced" i18n-preHtml preHtml="Short text to tell people how they can support you (membership platform...)."></my-help> |
134 | <my-markdown-textarea | 134 | <my-markdown-textarea |
135 | id="support" formControlName="support" textareaWidth="500px" [previewColumn]="true" markdownType="enhanced" | 135 | id="support" formControlName="support" textareaWidth="500px" [previewColumn]="true" markdownType="enhanced" |
136 | [classes]="{ 'input-error': formErrors['support'] }" | 136 | [classes]="{ 'input-error': formErrors['support'] }" |
137 | ></my-markdown-textarea> | 137 | ></my-markdown-textarea> |
138 | <div *ngIf="formErrors.support" class="form-error"> | 138 | <div *ngIf="formErrors.support" class="form-error"> |
139 | {{ formErrors.support }} | 139 | {{ formErrors.support }} |
diff --git a/client/src/app/videos/+video-edit/shared/video-image.component.html b/client/src/app/videos/+video-edit/shared/video-image.component.html index 5d0624f8c..e319d7ee7 100644 --- a/client/src/app/videos/+video-edit/shared/video-image.component.html +++ b/client/src/app/videos/+video-edit/shared/video-image.component.html | |||
@@ -8,7 +8,7 @@ | |||
8 | (change)="fileChange($event)" | 8 | (change)="fileChange($event)" |
9 | /> | 9 | /> |
10 | </div> | 10 | </div> |
11 | <div class="image-constraints">(extensions: {{ videoImageExtensions }}, max size: {{ maxVideoImageSize | bytes }})</div> | 11 | <div i18n class="image-constraints">(extensions: {{ videoImageExtensions }}, max size: {{ maxVideoImageSize | bytes }})</div> |
12 | </div> | 12 | </div> |
13 | 13 | ||
14 | <img *ngIf="imageSrc" [ngStyle]="{ width: previewWidth, height: previewHeight }" [src]="imageSrc" class="preview" /> | 14 | <img *ngIf="imageSrc" [ngStyle]="{ width: previewWidth, height: previewHeight }" [src]="imageSrc" class="preview" /> |
diff --git a/client/src/app/videos/+video-edit/video-add.component.html b/client/src/app/videos/+video-edit/video-add.component.html index 440556562..f00cfe016 100644 --- a/client/src/app/videos/+video-edit/video-add.component.html +++ b/client/src/app/videos/+video-edit/video-add.component.html | |||
@@ -1,7 +1,7 @@ | |||
1 | <div class="margin-content"> | 1 | <div class="margin-content"> |
2 | <div class="title-page title-page-single"> | 2 | <div class="title-page title-page-single"> |
3 | <ng-template [ngIf]="!videoFileName">Upload your video</ng-template> | 3 | <ng-container *ngIf="!videoFileName" i18n>Upload your video</ng-container> |
4 | <ng-template [ngIf]="videoFileName">Upload {{ videoFileName }}</ng-template> | 4 | <ng-container *ngIf="videoFileName" i18n>Upload {{ videoFileName }}</ng-container> |
5 | </div> | 5 | </div> |
6 | 6 | ||
7 | <div *ngIf="!isUploadingVideo" class="upload-video-container"> | 7 | <div *ngIf="!isUploadingVideo" class="upload-video-container"> |
@@ -9,12 +9,12 @@ | |||
9 | <div class="icon icon-upload"></div> | 9 | <div class="icon icon-upload"></div> |
10 | 10 | ||
11 | <div class="button-file"> | 11 | <div class="button-file"> |
12 | <span>Select the file to upload</span> | 12 | <span i18n>Select the file to upload</span> |
13 | <input #videofileInput type="file" name="videofile" id="videofile" [accept]="videoExtensions" (change)="fileChange()" /> | 13 | <input #videofileInput type="file" name="videofile" id="videofile" [accept]="videoExtensions" (change)="fileChange()" /> |
14 | </div> | 14 | </div> |
15 | 15 | ||
16 | <div class="form-group form-group-channel"> | 16 | <div class="form-group form-group-channel"> |
17 | <label for="first-step-channel">Channel</label> | 17 | <label i18n for="first-step-channel">Channel</label> |
18 | <div class="peertube-select-container"> | 18 | <div class="peertube-select-container"> |
19 | <select id="first-step-channel" [(ngModel)]="firstStepChannelId"> | 19 | <select id="first-step-channel" [(ngModel)]="firstStepChannelId"> |
20 | <option *ngFor="let channel of userVideoChannels" [value]="channel.id">{{ channel.label }}</option> | 20 | <option *ngFor="let channel of userVideoChannels" [value]="channel.id">{{ channel.label }}</option> |
@@ -23,7 +23,7 @@ | |||
23 | </div> | 23 | </div> |
24 | 24 | ||
25 | <div class="form-group"> | 25 | <div class="form-group"> |
26 | <label for="first-step-privacy">Privacy</label> | 26 | <label i18n for="first-step-privacy">Privacy</label> |
27 | <div class="peertube-select-container"> | 27 | <div class="peertube-select-container"> |
28 | <select id="first-step-privacy" [(ngModel)]="firstStepPrivacyId"> | 28 | <select id="first-step-privacy" [(ngModel)]="firstStepPrivacyId"> |
29 | <option *ngFor="let privacy of videoPrivacies" [value]="privacy.id">{{ privacy.label }}</option> | 29 | <option *ngFor="let privacy of videoPrivacies" [value]="privacy.id">{{ privacy.label }}</option> |
@@ -49,14 +49,14 @@ | |||
49 | ></my-video-edit> | 49 | ></my-video-edit> |
50 | 50 | ||
51 | <div class="submit-container"> | 51 | <div class="submit-container"> |
52 | <div *ngIf="videoUploaded === false" class="message-submit">Publish will be available when upload is finished</div> | 52 | <div i18n *ngIf="videoUploaded === false" class="message-submit">Publish will be available when upload is finished</div> |
53 | 53 | ||
54 | <div class="submit-button" | 54 | <div class="submit-button" |
55 | (click)="updateSecondStep()" | 55 | (click)="updateSecondStep()" |
56 | [ngClass]="{ disabled: !form.valid || isUpdatingVideo === true || videoUploaded !== true }" | 56 | [ngClass]="{ disabled: !form.valid || isUpdatingVideo === true || videoUploaded !== true }" |
57 | > | 57 | > |
58 | <span class="icon icon-validate"></span> | 58 | <span class="icon icon-validate"></span> |
59 | <input type="button" value="Publish" /> | 59 | <input type="button" i18n-value value="Publish" /> |
60 | </div> | 60 | </div> |
61 | </div> | 61 | </div> |
62 | </form> | 62 | </form> |
diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts index 997f033b7..a615fd92c 100644 --- a/client/src/app/videos/+video-edit/video-add.component.ts +++ b/client/src/app/videos/+video-edit/video-add.component.ts | |||
@@ -15,6 +15,7 @@ import { ValidatorMessage } from '../../shared/forms/form-validators/validator-m | |||
15 | import { populateAsyncUserVideoChannels } from '../../shared/misc/utils' | 15 | import { populateAsyncUserVideoChannels } from '../../shared/misc/utils' |
16 | import { VideoEdit } from '../../shared/video/video-edit.model' | 16 | import { VideoEdit } from '../../shared/video/video-edit.model' |
17 | import { VideoService } from '../../shared/video/video.service' | 17 | import { VideoService } from '../../shared/video/video.service' |
18 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
18 | 19 | ||
19 | @Component({ | 20 | @Component({ |
20 | selector: 'my-videos-add', | 21 | selector: 'my-videos-add', |
@@ -56,7 +57,8 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy | |||
56 | private userService: UserService, | 57 | private userService: UserService, |
57 | private serverService: ServerService, | 58 | private serverService: ServerService, |
58 | private videoService: VideoService, | 59 | private videoService: VideoService, |
59 | private loadingBar: LoadingBarService | 60 | private loadingBar: LoadingBarService, |
61 | private i18n: I18n | ||
60 | ) { | 62 | ) { |
61 | super() | 63 | super() |
62 | } | 64 | } |
@@ -99,10 +101,11 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy | |||
99 | let text = '' | 101 | let text = '' |
100 | 102 | ||
101 | if (this.videoUploaded === true) { | 103 | if (this.videoUploaded === true) { |
102 | text = 'Your video was uploaded in your account and is private.' + | 104 | // FIXME: cannot concatenate strings inside i18n service :/ |
103 | ' But associated data (tags, description...) will be lost, are you sure you want to leave this page?' | 105 | text = this.i18n('Your video was uploaded in your account and is private.') + |
106 | this.i18n('But associated data (tags, description...) will be lost, are you sure you want to leave this page?') | ||
104 | } else { | 107 | } else { |
105 | text = 'Your video is not uploaded yet, are you sure you want to leave this page?' | 108 | text = this.i18n('Your video is not uploaded yet, are you sure you want to leave this page?') |
106 | } | 109 | } |
107 | 110 | ||
108 | return { | 111 | return { |
@@ -127,7 +130,7 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy | |||
127 | this.isUploadingVideo = false | 130 | this.isUploadingVideo = false |
128 | this.videoUploadPercents = 0 | 131 | this.videoUploadPercents = 0 |
129 | this.videoUploadObservable = null | 132 | this.videoUploadObservable = null |
130 | this.notificationsService.info('Info', 'Upload cancelled') | 133 | this.notificationsService.info(this.i18n('Info'), this.i18n('Upload cancelled')) |
131 | } | 134 | } |
132 | } | 135 | } |
133 | 136 | ||
@@ -137,7 +140,7 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy | |||
137 | 140 | ||
138 | // Cannot upload videos > 4GB for now | 141 | // Cannot upload videos > 4GB for now |
139 | if (videofile.size > 4 * 1024 * 1024 * 1024) { | 142 | if (videofile.size > 4 * 1024 * 1024 * 1024) { |
140 | this.notificationsService.error('Error', 'We are sorry but PeerTube cannot handle videos > 4GB') | 143 | this.notificationsService.error(this.i18n('Error'), this.i18n('We are sorry but PeerTube cannot handle videos > 4GB')) |
141 | return | 144 | return |
142 | } | 145 | } |
143 | 146 | ||
@@ -145,11 +148,15 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy | |||
145 | if (videoQuota !== -1 && (this.userVideoQuotaUsed + videofile.size) > videoQuota) { | 148 | if (videoQuota !== -1 && (this.userVideoQuotaUsed + videofile.size) > videoQuota) { |
146 | const bytePipes = new BytesPipe() | 149 | const bytePipes = new BytesPipe() |
147 | 150 | ||
148 | const msg = 'Your video quota is exceeded with this video ' + | 151 | const msg = this.i18n( |
149 | `(video size: ${bytePipes.transform(videofile.size, 0)}, ` + | 152 | 'Your video quota is exceeded with this video (video size: {{ videoSize }}, used: {{ videoQuotaUsed }}, quota: {{ videoQuota }})', |
150 | `used: ${bytePipes.transform(this.userVideoQuotaUsed, 0)}, ` + | 153 | { |
151 | `quota: ${bytePipes.transform(videoQuota, 0)})` | 154 | videoSize: bytePipes.transform(videofile.size, 0), |
152 | this.notificationsService.error('Error', msg) | 155 | videoQuotaUsed: bytePipes.transform(this.userVideoQuotaUsed, 0), |
156 | videoQuota: bytePipes.transform(videoQuota, 0) | ||
157 | } | ||
158 | ) | ||
159 | this.notificationsService.error(this.i18n('Error'), msg) | ||
153 | return | 160 | return |
154 | } | 161 | } |
155 | 162 | ||
@@ -192,8 +199,6 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy | |||
192 | if (event.type === HttpEventType.UploadProgress) { | 199 | if (event.type === HttpEventType.UploadProgress) { |
193 | this.videoUploadPercents = Math.round(100 * event.loaded / event.total) | 200 | this.videoUploadPercents = Math.round(100 * event.loaded / event.total) |
194 | } else if (event instanceof HttpResponse) { | 201 | } else if (event instanceof HttpResponse) { |
195 | console.log('Video uploaded.') | ||
196 | |||
197 | this.videoUploaded = true | 202 | this.videoUploaded = true |
198 | 203 | ||
199 | this.videoUploadedIds = event.body.video | 204 | this.videoUploadedIds = event.body.video |
@@ -207,7 +212,7 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy | |||
207 | this.isUploadingVideo = false | 212 | this.isUploadingVideo = false |
208 | this.videoUploadPercents = 0 | 213 | this.videoUploadPercents = 0 |
209 | this.videoUploadObservable = null | 214 | this.videoUploadObservable = null |
210 | this.notificationsService.error('Error', err.message) | 215 | this.notificationsService.error(this.i18n('Error'), err.message) |
211 | } | 216 | } |
212 | ) | 217 | ) |
213 | } | 218 | } |
@@ -231,13 +236,13 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy | |||
231 | this.isUploadingVideo = false | 236 | this.isUploadingVideo = false |
232 | this.loadingBar.complete() | 237 | this.loadingBar.complete() |
233 | 238 | ||
234 | this.notificationsService.success('Success', 'Video published.') | 239 | this.notificationsService.success(this.i18n('Success'), this.i18n('Video published.')) |
235 | this.router.navigate([ '/videos/watch', video.uuid ]) | 240 | this.router.navigate([ '/videos/watch', video.uuid ]) |
236 | }, | 241 | }, |
237 | 242 | ||
238 | err => { | 243 | err => { |
239 | this.isUpdatingVideo = false | 244 | this.isUpdatingVideo = false |
240 | this.notificationsService.error('Error', err.message) | 245 | this.notificationsService.error(this.i18n('Error'), err.message) |
241 | console.error(err) | 246 | console.error(err) |
242 | } | 247 | } |
243 | ) | 248 | ) |
diff --git a/client/src/app/videos/+video-edit/video-update.component.html b/client/src/app/videos/+video-edit/video-update.component.html index a1b4707be..73b2bc08f 100644 --- a/client/src/app/videos/+video-edit/video-update.component.html +++ b/client/src/app/videos/+video-edit/video-update.component.html | |||
@@ -1,5 +1,5 @@ | |||
1 | <div class="margin-content"> | 1 | <div class="margin-content"> |
2 | <div class="title-page title-page-single"> | 2 | <div i18n class="title-page title-page-single"> |
3 | Update {{ video?.name }} | 3 | Update {{ video?.name }} |
4 | </div> | 4 | </div> |
5 | 5 | ||
@@ -13,7 +13,7 @@ | |||
13 | <div class="submit-container"> | 13 | <div class="submit-container"> |
14 | <div class="submit-button" (click)="update()" [ngClass]="{ disabled: !form.valid || isUpdatingVideo === true }"> | 14 | <div class="submit-button" (click)="update()" [ngClass]="{ disabled: !form.valid || isUpdatingVideo === true }"> |
15 | <span class="icon icon-validate"></span> | 15 | <span class="icon icon-validate"></span> |
16 | <input type="button" value="Update" /> | 16 | <input type="button" i18n-value value="Update" /> |
17 | </div> | 17 | </div> |
18 | </div> | 18 | </div> |
19 | </form> | 19 | </form> |
diff --git a/client/src/app/videos/+video-edit/video-update.component.ts b/client/src/app/videos/+video-edit/video-update.component.ts index 310285f92..e37dd526f 100644 --- a/client/src/app/videos/+video-edit/video-update.component.ts +++ b/client/src/app/videos/+video-edit/video-update.component.ts | |||
@@ -12,6 +12,7 @@ import { ValidatorMessage } from '../../shared/forms/form-validators/validator-m | |||
12 | import { VideoEdit } from '../../shared/video/video-edit.model' | 12 | import { VideoEdit } from '../../shared/video/video-edit.model' |
13 | import { VideoService } from '../../shared/video/video.service' | 13 | import { VideoService } from '../../shared/video/video.service' |
14 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | 14 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' |
15 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
15 | 16 | ||
16 | @Component({ | 17 | @Component({ |
17 | selector: 'my-videos-update', | 18 | selector: 'my-videos-update', |
@@ -37,7 +38,8 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
37 | private videoService: VideoService, | 38 | private videoService: VideoService, |
38 | private authService: AuthService, | 39 | private authService: AuthService, |
39 | private loadingBar: LoadingBarService, | 40 | private loadingBar: LoadingBarService, |
40 | private videoChannelService: VideoChannelService | 41 | private videoChannelService: VideoChannelService, |
42 | private i18n: I18n | ||
41 | ) { | 43 | ) { |
42 | super() | 44 | super() |
43 | } | 45 | } |
@@ -91,7 +93,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
91 | 93 | ||
92 | err => { | 94 | err => { |
93 | console.error(err) | 95 | console.error(err) |
94 | this.notificationsService.error('Error', err.message) | 96 | this.notificationsService.error(this.i18n('Error'), err.message) |
95 | } | 97 | } |
96 | ) | 98 | ) |
97 | } | 99 | } |
@@ -116,13 +118,13 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
116 | () => { | 118 | () => { |
117 | this.isUpdatingVideo = false | 119 | this.isUpdatingVideo = false |
118 | this.loadingBar.complete() | 120 | this.loadingBar.complete() |
119 | this.notificationsService.success('Success', 'Video updated.') | 121 | this.notificationsService.success(this.i18n('Success'), this.i18n('Video updated.')) |
120 | this.router.navigate([ '/videos/watch', this.video.uuid ]) | 122 | this.router.navigate([ '/videos/watch', this.video.uuid ]) |
121 | }, | 123 | }, |
122 | 124 | ||
123 | err => { | 125 | err => { |
124 | this.isUpdatingVideo = false | 126 | this.isUpdatingVideo = false |
125 | this.notificationsService.error('Error', err.message) | 127 | this.notificationsService.error(this.i18n('Error'), err.message) |
126 | console.error(err) | 128 | console.error(err) |
127 | } | 129 | } |
128 | ) | 130 | ) |
diff --git a/client/src/app/videos/+video-watch/comment/video-comment-add.component.html b/client/src/app/videos/+video-watch/comment/video-comment-add.component.html index 54d7286db..eaf068cfa 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment-add.component.html +++ b/client/src/app/videos/+video-watch/comment/video-comment-add.component.html | |||
@@ -3,7 +3,7 @@ | |||
3 | <img [src]="user.accountAvatarUrl" alt="Avatar" /> | 3 | <img [src]="user.accountAvatarUrl" alt="Avatar" /> |
4 | 4 | ||
5 | <div class="form-group"> | 5 | <div class="form-group"> |
6 | <textarea placeholder="Add comment..." formControlName="text" [ngClass]="{ 'input-error': formErrors['text'] }" | 6 | <textarea i18n-placeholder placeholder="Add comment..." formControlName="text" [ngClass]="{ 'input-error': formErrors['text'] }" |
7 | (keyup.control.enter)="onValidKey()" (keyup.meta.enter)="onValidKey()" #textarea> | 7 | (keyup.control.enter)="onValidKey()" (keyup.meta.enter)="onValidKey()" #textarea> |
8 | 8 | ||
9 | </textarea> | 9 | </textarea> |
@@ -14,7 +14,7 @@ | |||
14 | </div> | 14 | </div> |
15 | 15 | ||
16 | <div class="submit-comment"> | 16 | <div class="submit-comment"> |
17 | <button *ngIf="isAddButtonDisplayed()" [ngClass]="{ disabled: !form.valid }"> | 17 | <button *ngIf="isAddButtonDisplayed()" [ngClass]="{ disabled: !form.valid }" i18n> |
18 | Post comment | 18 | Post comment |
19 | </button> | 19 | </button> |
20 | </div> | 20 | </div> |
diff --git a/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts b/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts index b1f446475..2ee5f5ef1 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts +++ b/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts | |||
@@ -9,6 +9,7 @@ import { User } from '../../../shared/users' | |||
9 | import { Video } from '../../../shared/video/video.model' | 9 | import { Video } from '../../../shared/video/video.model' |
10 | import { VideoComment } from './video-comment.model' | 10 | import { VideoComment } from './video-comment.model' |
11 | import { VideoCommentService } from './video-comment.service' | 11 | import { VideoCommentService } from './video-comment.service' |
12 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
12 | 13 | ||
13 | @Component({ | 14 | @Component({ |
14 | selector: 'my-video-comment-add', | 15 | selector: 'my-video-comment-add', |
@@ -37,7 +38,8 @@ export class VideoCommentAddComponent extends FormReactive implements OnInit { | |||
37 | constructor ( | 38 | constructor ( |
38 | private formBuilder: FormBuilder, | 39 | private formBuilder: FormBuilder, |
39 | private notificationsService: NotificationsService, | 40 | private notificationsService: NotificationsService, |
40 | private videoCommentService: VideoCommentService | 41 | private videoCommentService: VideoCommentService, |
42 | private i18n: I18n | ||
41 | ) { | 43 | ) { |
42 | super() | 44 | super() |
43 | } | 45 | } |
@@ -92,7 +94,7 @@ export class VideoCommentAddComponent extends FormReactive implements OnInit { | |||
92 | this.form.reset() | 94 | this.form.reset() |
93 | }, | 95 | }, |
94 | 96 | ||
95 | err => this.notificationsService.error('Error', err.text) | 97 | err => this.notificationsService.error(this.i18n('Error'), err.text) |
96 | ) | 98 | ) |
97 | } | 99 | } |
98 | 100 | ||
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.component.html b/client/src/app/videos/+video-watch/comment/video-comment.component.html index 06808ef80..60b803206 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment.component.html +++ b/client/src/app/videos/+video-watch/comment/video-comment.component.html | |||
@@ -2,7 +2,7 @@ | |||
2 | <img [src]="comment.accountAvatarUrl" alt="Avatar" /> | 2 | <img [src]="comment.accountAvatarUrl" alt="Avatar" /> |
3 | 3 | ||
4 | <div class="comment"> | 4 | <div class="comment"> |
5 | <div *ngIf="highlightedComment === true" class="highlighted-comment">Highlighted comment</div> | 5 | <div *ngIf="highlightedComment === true" class="highlighted-comment" i18n>Highlighted comment</div> |
6 | 6 | ||
7 | <div class="comment-account-date"> | 7 | <div class="comment-account-date"> |
8 | <a [href]="comment.account.url" target="_blank" rel="noopener noreferrer" class="comment-account">{{ comment.by }}</a> | 8 | <a [href]="comment.account.url" target="_blank" rel="noopener noreferrer" class="comment-account">{{ comment.by }}</a> |
@@ -11,8 +11,8 @@ | |||
11 | <div class="comment-html" [innerHTML]="sanitizedCommentHTML"></div> | 11 | <div class="comment-html" [innerHTML]="sanitizedCommentHTML"></div> |
12 | 12 | ||
13 | <div class="comment-actions"> | 13 | <div class="comment-actions"> |
14 | <div *ngIf="isUserLoggedIn()" (click)="onWantToReply()" class="comment-action-reply">Reply</div> | 14 | <div *ngIf="isUserLoggedIn()" (click)="onWantToReply()" class="comment-action-reply" i18n>Reply</div> |
15 | <div *ngIf="isRemovableByUser()" (click)="onWantToDelete()" class="comment-action-delete">Delete</div> | 15 | <div *ngIf="isRemovableByUser()" (click)="onWantToDelete()" class="comment-action-delete" i18n>Delete</div> |
16 | </div> | 16 | </div> |
17 | 17 | ||
18 | <my-video-comment-add | 18 | <my-video-comment-add |
diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.html b/client/src/app/videos/+video-watch/comment/video-comments.component.html index 114a56dc7..ac7c03648 100644 --- a/client/src/app/videos/+video-watch/comment/video-comments.component.html +++ b/client/src/app/videos/+video-watch/comment/video-comments.component.html | |||
@@ -3,7 +3,10 @@ | |||
3 | <div class="title-page title-page-single"> | 3 | <div class="title-page title-page-single"> |
4 | Comments | 4 | Comments |
5 | </div> | 5 | </div> |
6 | <my-help *ngIf="video.commentsEnabled === true" helpType="custom" customHtml="You can either comment on the page of your instance where this video is federated with your PeerTube account, or via any ActivityPub-capable fediverse instance. For instance with Mastodon or Pleroma you can type in the search box <strong>@{{video.account.displayName}}@{{video.account.host}}</strong> and find back the video. Direct commenting capabilities are being worked on in <a href='https://github.com/Chocobozzz/PeerTube/issues/224'>#224</a>."></my-help> | 6 | <my-help |
7 | *ngIf="video.commentsEnabled === true" helpType="custom" i18n-customHtml | ||
8 | customHtml="You can either comment on the page of your instance where this video is federated with your PeerTube account, or via any ActivityPub-capable fediverse instance. For instance with Mastodon or Pleroma you can type in the search box <strong>@{{video.account.displayName}}@{{video.account.host}}</strong> and find back the video. Direct commenting capabilities are being worked on in <a href='https://github.com/Chocobozzz/PeerTube/issues/224'>#224</a>." | ||
9 | ></my-help> | ||
7 | </div> | 10 | </div> |
8 | 11 | ||
9 | <ng-template [ngIf]="video.commentsEnabled === true"> | 12 | <ng-template [ngIf]="video.commentsEnabled === true"> |
@@ -14,7 +17,7 @@ | |||
14 | (commentCreated)="onCommentThreadCreated($event)" | 17 | (commentCreated)="onCommentThreadCreated($event)" |
15 | ></my-video-comment-add> | 18 | ></my-video-comment-add> |
16 | 19 | ||
17 | <div *ngIf="componentPagination.totalItems === 0 && comments.length === 0">No comments.</div> | 20 | <div *ngIf="componentPagination.totalItems === 0 && comments.length === 0" i18n>No comments.</div> |
18 | 21 | ||
19 | <div | 22 | <div |
20 | class="comment-threads" | 23 | class="comment-threads" |
@@ -24,15 +27,15 @@ | |||
24 | > | 27 | > |
25 | <div *ngIf="highlightedThread" id="highlighted-comment"> | 28 | <div *ngIf="highlightedThread" id="highlighted-comment"> |
26 | <my-video-comment | 29 | <my-video-comment |
27 | [comment]="highlightedThread" | 30 | [comment]="highlightedThread" |
28 | [video]="video" | 31 | [video]="video" |
29 | [inReplyToCommentId]="inReplyToCommentId" | 32 | [inReplyToCommentId]="inReplyToCommentId" |
30 | [commentTree]="threadComments[highlightedThread.id]" | 33 | [commentTree]="threadComments[highlightedThread.id]" |
31 | [highlightedComment]="true" | 34 | [highlightedComment]="true" |
32 | (wantedToReply)="onWantedToReply($event)" | 35 | (wantedToReply)="onWantedToReply($event)" |
33 | (wantedToDelete)="onWantedToDelete($event)" | 36 | (wantedToDelete)="onWantedToDelete($event)" |
34 | (threadCreated)="onThreadCreated($event)" | 37 | (threadCreated)="onThreadCreated($event)" |
35 | (resetReply)="onResetReply()" | 38 | (resetReply)="onResetReply()" |
36 | ></my-video-comment> | 39 | ></my-video-comment> |
37 | </div> | 40 | </div> |
38 | 41 | ||
@@ -50,7 +53,7 @@ | |||
50 | ></my-video-comment> | 53 | ></my-video-comment> |
51 | 54 | ||
52 | <div *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment.id)" class="view-replies"> | 55 | <div *ngIf="comment.totalReplies !== 0 && !threadComments[comment.id]" (click)="viewReplies(comment.id)" class="view-replies"> |
53 | View all {{ comment.totalReplies }} replies | 56 | <ng-container i18n>View all {{ comment.totalReplies }} replies</ng-container> |
54 | 57 | ||
55 | <span *ngIf="!threadLoading[comment.id]" class="glyphicon glyphicon-menu-down"></span> | 58 | <span *ngIf="!threadLoading[comment.id]" class="glyphicon glyphicon-menu-down"></span> |
56 | <my-loader class="comment-thread-loading" [loading]="threadLoading[comment.id]"></my-loader> | 59 | <my-loader class="comment-thread-loading" [loading]="threadLoading[comment.id]"></my-loader> |
@@ -59,7 +62,7 @@ | |||
59 | </div> | 62 | </div> |
60 | </ng-template> | 63 | </ng-template> |
61 | 64 | ||
62 | <div *ngIf="video.commentsEnabled === false"> | 65 | <div *ngIf="video.commentsEnabled === false" i18n> |
63 | Comments are disabled. | 66 | Comments are disabled. |
64 | </div> | 67 | </div> |
65 | </div> | 68 | </div> |
diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.ts b/client/src/app/videos/+video-watch/comment/video-comments.component.ts index 34f4a0701..8c6ddb89e 100644 --- a/client/src/app/videos/+video-watch/comment/video-comments.component.ts +++ b/client/src/app/videos/+video-watch/comment/video-comments.component.ts | |||
@@ -11,6 +11,7 @@ import { VideoSortField } from '../../../shared/video/sort-field.type' | |||
11 | import { VideoDetails } from '../../../shared/video/video-details.model' | 11 | import { VideoDetails } from '../../../shared/video/video-details.model' |
12 | import { VideoComment } from './video-comment.model' | 12 | import { VideoComment } from './video-comment.model' |
13 | import { VideoCommentService } from './video-comment.service' | 13 | import { VideoCommentService } from './video-comment.service' |
14 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
14 | 15 | ||
15 | @Component({ | 16 | @Component({ |
16 | selector: 'my-video-comments', | 17 | selector: 'my-video-comments', |
@@ -40,7 +41,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
40 | private notificationsService: NotificationsService, | 41 | private notificationsService: NotificationsService, |
41 | private confirmService: ConfirmService, | 42 | private confirmService: ConfirmService, |
42 | private videoCommentService: VideoCommentService, | 43 | private videoCommentService: VideoCommentService, |
43 | private activatedRoute: ActivatedRoute | 44 | private activatedRoute: ActivatedRoute, |
45 | private i18n: I18n | ||
44 | ) {} | 46 | ) {} |
45 | 47 | ||
46 | ngOnInit () { | 48 | ngOnInit () { |
@@ -77,7 +79,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
77 | if (highlightThread) this.highlightedThread = new VideoComment(res.comment) | 79 | if (highlightThread) this.highlightedThread = new VideoComment(res.comment) |
78 | }, | 80 | }, |
79 | 81 | ||
80 | err => this.notificationsService.error('Error', err.message) | 82 | err => this.notificationsService.error(this.i18n('Error'), err.message) |
81 | ) | 83 | ) |
82 | } | 84 | } |
83 | 85 | ||
@@ -89,7 +91,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
89 | this.componentPagination.totalItems = res.totalComments | 91 | this.componentPagination.totalItems = res.totalComments |
90 | }, | 92 | }, |
91 | 93 | ||
92 | err => this.notificationsService.error('Error', err.message) | 94 | err => this.notificationsService.error(this.i18n('Error'), err.message) |
93 | ) | 95 | ) |
94 | } | 96 | } |
95 | 97 | ||
@@ -111,9 +113,11 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
111 | 113 | ||
112 | async onWantedToDelete (commentToDelete: VideoComment) { | 114 | async onWantedToDelete (commentToDelete: VideoComment) { |
113 | let message = 'Do you really want to delete this comment?' | 115 | let message = 'Do you really want to delete this comment?' |
114 | if (commentToDelete.totalReplies !== 0) message += `${commentToDelete.totalReplies} would be deleted too.` | 116 | if (commentToDelete.totalReplies !== 0) { |
117 | message += this.i18n(' {{ totalReplies }} replies will be deleted too.', { totalReplies: commentToDelete.totalReplies }) | ||
118 | } | ||
115 | 119 | ||
116 | const res = await this.confirmService.confirm(message, 'Delete') | 120 | const res = await this.confirmService.confirm(message, this.i18n('Delete')) |
117 | if (res === false) return | 121 | if (res === false) return |
118 | 122 | ||
119 | this.videoCommentService.deleteVideoComment(commentToDelete.videoId, commentToDelete.id) | 123 | this.videoCommentService.deleteVideoComment(commentToDelete.videoId, commentToDelete.id) |
@@ -136,7 +140,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
136 | this.componentPagination.totalItems-- | 140 | this.componentPagination.totalItems-- |
137 | }, | 141 | }, |
138 | 142 | ||
139 | err => this.notificationsService.error('Error', err.message) | 143 | err => this.notificationsService.error(this.i18n('Error'), err.message) |
140 | ) | 144 | ) |
141 | } | 145 | } |
142 | 146 | ||
diff --git a/client/src/app/videos/+video-watch/modal/video-download.component.html b/client/src/app/videos/+video-watch/modal/video-download.component.html index 617892b11..d30a49345 100644 --- a/client/src/app/videos/+video-watch/modal/video-download.component.html +++ b/client/src/app/videos/+video-watch/modal/video-download.component.html | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | <div class="modal-header"> | 5 | <div class="modal-header"> |
6 | <span class="close" aria-hidden="true" (click)="hide()"></span> | 6 | <span class="close" aria-hidden="true" (click)="hide()"></span> |
7 | <h4 class="modal-title">Download video</h4> | 7 | <h4 i18n class="modal-title">Download video</h4> |
8 | </div> | 8 | </div> |
9 | 9 | ||
10 | <div class="modal-body"> | 10 | <div class="modal-body"> |
@@ -17,22 +17,22 @@ | |||
17 | <div class="download-type"> | 17 | <div class="download-type"> |
18 | <div class="peertube-radio-container"> | 18 | <div class="peertube-radio-container"> |
19 | <input type="radio" name="download" id="download-torrent" [(ngModel)]="downloadType" value="torrent"> | 19 | <input type="radio" name="download" id="download-torrent" [(ngModel)]="downloadType" value="torrent"> |
20 | <label for="download-torrent">Torrent</label> | 20 | <label i18n for="download-torrent">Torrent</label> |
21 | </div> | 21 | </div> |
22 | 22 | ||
23 | <div class="peertube-radio-container"> | 23 | <div class="peertube-radio-container"> |
24 | <input type="radio" name="download" id="download-direct" [(ngModel)]="downloadType" value="direct"> | 24 | <input type="radio" name="download" id="download-direct" [(ngModel)]="downloadType" value="direct"> |
25 | <label for="download-direct">Direct download</label> | 25 | <label i18n for="download-direct">Direct download</label> |
26 | </div> | 26 | </div> |
27 | </div> | 27 | </div> |
28 | 28 | ||
29 | <div class="form-group inputs"> | 29 | <div class="form-group inputs"> |
30 | <span class="action-button action-button-cancel" (click)="hide()"> | 30 | <span i18n class="action-button action-button-cancel" (click)="hide()"> |
31 | Cancel | 31 | Cancel |
32 | </span> | 32 | </span> |
33 | 33 | ||
34 | <input | 34 | <input |
35 | type="submit" value="Download" class="action-button-submit" | 35 | type="submit" i18n-value value="Download" class="action-button-submit" |
36 | (click)="download()" | 36 | (click)="download()" |
37 | > | 37 | > |
38 | </div> | 38 | </div> |
diff --git a/client/src/app/videos/+video-watch/modal/video-report.component.html b/client/src/app/videos/+video-watch/modal/video-report.component.html index a9a7beb48..4ee3721fb 100644 --- a/client/src/app/videos/+video-watch/modal/video-report.component.html +++ b/client/src/app/videos/+video-watch/modal/video-report.component.html | |||
@@ -4,14 +4,14 @@ | |||
4 | 4 | ||
5 | <div class="modal-header"> | 5 | <div class="modal-header"> |
6 | <span class="close" aria-hidden="true" (click)="hide()"></span> | 6 | <span class="close" aria-hidden="true" (click)="hide()"></span> |
7 | <h4 class="modal-title">Report video</h4> | 7 | <h4 i18n class="modal-title">Report video</h4> |
8 | </div> | 8 | </div> |
9 | 9 | ||
10 | <div class="modal-body"> | 10 | <div class="modal-body"> |
11 | 11 | ||
12 | <form novalidate [formGroup]="form" (ngSubmit)="report()"> | 12 | <form novalidate [formGroup]="form" (ngSubmit)="report()"> |
13 | <div class="form-group"> | 13 | <div class="form-group"> |
14 | <textarea placeholder="Reason..." formControlName="reason" [ngClass]="{ 'input-error': formErrors['reason'] }"> | 14 | <textarea i18n-placeholder placeholder="Reason..." formControlName="reason" [ngClass]="{ 'input-error': formErrors['reason'] }"> |
15 | </textarea> | 15 | </textarea> |
16 | <div *ngIf="formErrors.reason" class="form-error"> | 16 | <div *ngIf="formErrors.reason" class="form-error"> |
17 | {{ formErrors.reason }} | 17 | {{ formErrors.reason }} |
@@ -19,12 +19,12 @@ | |||
19 | </div> | 19 | </div> |
20 | 20 | ||
21 | <div class="form-group inputs"> | 21 | <div class="form-group inputs"> |
22 | <span class="action-button action-button-cancel" (click)="hide()"> | 22 | <span i18n class="action-button action-button-cancel" (click)="hide()"> |
23 | Cancel | 23 | Cancel |
24 | </span> | 24 | </span> |
25 | 25 | ||
26 | <input | 26 | <input |
27 | type="submit" value="Submit" class="action-button-submit" | 27 | type="submit" i18n-value value="Submit" class="action-button-submit" |
28 | [disabled]="!form.valid" | 28 | [disabled]="!form.valid" |
29 | > | 29 | > |
30 | </div> | 30 | </div> |
diff --git a/client/src/app/videos/+video-watch/modal/video-report.component.ts b/client/src/app/videos/+video-watch/modal/video-report.component.ts index 050e827e7..1bbd30226 100644 --- a/client/src/app/videos/+video-watch/modal/video-report.component.ts +++ b/client/src/app/videos/+video-watch/modal/video-report.component.ts | |||
@@ -4,6 +4,7 @@ import { NotificationsService } from 'angular2-notifications' | |||
4 | import { ModalDirective } from 'ngx-bootstrap/modal' | 4 | import { ModalDirective } from 'ngx-bootstrap/modal' |
5 | import { FormReactive, VIDEO_ABUSE_REASON, VideoAbuseService } from '../../../shared/index' | 5 | import { FormReactive, VIDEO_ABUSE_REASON, VideoAbuseService } from '../../../shared/index' |
6 | import { VideoDetails } from '../../../shared/video/video-details.model' | 6 | import { VideoDetails } from '../../../shared/video/video-details.model' |
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
7 | 8 | ||
8 | @Component({ | 9 | @Component({ |
9 | selector: 'my-video-report', | 10 | selector: 'my-video-report', |
@@ -27,8 +28,9 @@ export class VideoReportComponent extends FormReactive implements OnInit { | |||
27 | constructor ( | 28 | constructor ( |
28 | private formBuilder: FormBuilder, | 29 | private formBuilder: FormBuilder, |
29 | private videoAbuseService: VideoAbuseService, | 30 | private videoAbuseService: VideoAbuseService, |
30 | private notificationsService: NotificationsService | 31 | private notificationsService: NotificationsService, |
31 | ) { | 32 | private i18n: I18n |
33 | ) { | ||
32 | super() | 34 | super() |
33 | } | 35 | } |
34 | 36 | ||
@@ -58,11 +60,11 @@ export class VideoReportComponent extends FormReactive implements OnInit { | |||
58 | this.videoAbuseService.reportVideo(this.video.id, reason) | 60 | this.videoAbuseService.reportVideo(this.video.id, reason) |
59 | .subscribe( | 61 | .subscribe( |
60 | () => { | 62 | () => { |
61 | this.notificationsService.success('Success', 'Video reported.') | 63 | this.notificationsService.success(this.i18n('Success'), this.i18n('Video reported.')) |
62 | this.hide() | 64 | this.hide() |
63 | }, | 65 | }, |
64 | 66 | ||
65 | err => this.notificationsService.error('Error', err.message) | 67 | err => this.notificationsService.error(this.i18n('Error'), err.message) |
66 | ) | 68 | ) |
67 | } | 69 | } |
68 | } | 70 | } |
diff --git a/client/src/app/videos/+video-watch/modal/video-share.component.html b/client/src/app/videos/+video-watch/modal/video-share.component.html index 85cf10a6c..26ab5144a 100644 --- a/client/src/app/videos/+video-watch/modal/video-share.component.html +++ b/client/src/app/videos/+video-watch/modal/video-share.component.html | |||
@@ -4,12 +4,12 @@ | |||
4 | 4 | ||
5 | <div class="modal-header"> | 5 | <div class="modal-header"> |
6 | <span class="close" aria-hidden="true" (click)="hide()"></span> | 6 | <span class="close" aria-hidden="true" (click)="hide()"></span> |
7 | <h4 class="modal-title">Share</h4> | 7 | <h4 i18n class="modal-title">Share</h4> |
8 | </div> | 8 | </div> |
9 | 9 | ||
10 | <div class="modal-body"> | 10 | <div class="modal-body"> |
11 | <div class="form-group"> | 11 | <div class="form-group"> |
12 | <label>URL</label> | 12 | <label i18n>URL</label> |
13 | <div class="input-group input-group-sm"> | 13 | <div class="input-group input-group-sm"> |
14 | <input #urlInput (click)="urlInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getVideoUrl()" /> | 14 | <input #urlInput (click)="urlInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getVideoUrl()" /> |
15 | <div class="input-group-btn" placement="bottom right"> | 15 | <div class="input-group-btn" placement="bottom right"> |
@@ -21,7 +21,7 @@ | |||
21 | </div> | 21 | </div> |
22 | 22 | ||
23 | <div class="form-group"> | 23 | <div class="form-group"> |
24 | <label>Embed</label> | 24 | <label i18n>Embed</label> |
25 | <div class="input-group input-group-sm"> | 25 | <div class="input-group input-group-sm"> |
26 | <input #shareInput (click)="shareInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getVideoIframeCode()" /> | 26 | <input #shareInput (click)="shareInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getVideoIframeCode()" /> |
27 | <div class="input-group-btn" placement="bottom right"> | 27 | <div class="input-group-btn" placement="bottom right"> |
@@ -32,12 +32,12 @@ | |||
32 | </div> | 32 | </div> |
33 | </div> | 33 | </div> |
34 | 34 | ||
35 | <div *ngIf="notSecure()" class="alert alert-warning"> | 35 | <div i18n *ngIf="notSecure()" class="alert alert-warning"> |
36 | The url is not secured (no HTTPS), so the embed video won't work on HTTPS websites (web browsers block non secured HTTP requests on HTTPS websites). | 36 | The url is not secured (no HTTPS), so the embed video won't work on HTTPS websites (web browsers block non secured HTTP requests on HTTPS websites). |
37 | </div> | 37 | </div> |
38 | 38 | ||
39 | <div class="form-group inputs"> | 39 | <div class="form-group inputs"> |
40 | <span class="action-button action-button-cancel" (click)="hide()"> | 40 | <span i18n class="action-button action-button-cancel" (click)="hide()"> |
41 | Cancel | 41 | Cancel |
42 | </span> | 42 | </span> |
43 | </div> | 43 | </div> |
diff --git a/client/src/app/videos/+video-watch/modal/video-share.component.ts b/client/src/app/videos/+video-watch/modal/video-share.component.ts index 33998c5d8..5c988a43b 100644 --- a/client/src/app/videos/+video-watch/modal/video-share.component.ts +++ b/client/src/app/videos/+video-watch/modal/video-share.component.ts | |||
@@ -5,6 +5,7 @@ import { NotificationsService } from 'angular2-notifications' | |||
5 | import { ModalDirective } from 'ngx-bootstrap/modal' | 5 | import { ModalDirective } from 'ngx-bootstrap/modal' |
6 | import { VideoDetails } from '../../../shared/video/video-details.model' | 6 | import { VideoDetails } from '../../../shared/video/video-details.model' |
7 | import { buildVideoEmbed } from '../../../../assets/player/utils' | 7 | import { buildVideoEmbed } from '../../../../assets/player/utils' |
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
8 | 9 | ||
9 | @Component({ | 10 | @Component({ |
10 | selector: 'my-video-share', | 11 | selector: 'my-video-share', |
@@ -16,7 +17,10 @@ export class VideoShareComponent { | |||
16 | 17 | ||
17 | @ViewChild('modal') modal: ModalDirective | 18 | @ViewChild('modal') modal: ModalDirective |
18 | 19 | ||
19 | constructor (private notificationsService: NotificationsService) { | 20 | constructor ( |
21 | private notificationsService: NotificationsService, | ||
22 | private i18n: I18n | ||
23 | ) { | ||
20 | // empty | 24 | // empty |
21 | } | 25 | } |
22 | 26 | ||
@@ -41,6 +45,6 @@ export class VideoShareComponent { | |||
41 | } | 45 | } |
42 | 46 | ||
43 | activateCopiedMessage () { | 47 | activateCopiedMessage () { |
44 | this.notificationsService.success('Success', 'Copied') | 48 | this.notificationsService.success(this.i18n('Success'), this.i18n('Copied')) |
45 | } | 49 | } |
46 | } | 50 | } |
diff --git a/client/src/app/videos/+video-watch/modal/video-support.component.html b/client/src/app/videos/+video-watch/modal/video-support.component.html index 16ad9502a..9bcfcea47 100644 --- a/client/src/app/videos/+video-watch/modal/video-support.component.html +++ b/client/src/app/videos/+video-watch/modal/video-support.component.html | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | <div class="modal-header"> | 5 | <div class="modal-header"> |
6 | <span class="close" aria-hidden="true" (click)="hide()"></span> | 6 | <span class="close" aria-hidden="true" (click)="hide()"></span> |
7 | <h4 class="modal-title">Support</h4> | 7 | <h4 i18n class="modal-title">Support</h4> |
8 | </div> | 8 | </div> |
9 | 9 | ||
10 | <div class="modal-body"> | 10 | <div class="modal-body"> |
@@ -12,7 +12,7 @@ | |||
12 | <div [innerHTML]="videoHTMLSupport"></div> | 12 | <div [innerHTML]="videoHTMLSupport"></div> |
13 | 13 | ||
14 | <div class="form-group inputs"> | 14 | <div class="form-group inputs"> |
15 | <span class="action-button action-button-cancel" (click)="hide()"> | 15 | <span i18n class="action-button action-button-cancel" (click)="hide()"> |
16 | Cancel | 16 | Cancel |
17 | </span> | 17 | </span> |
18 | </div> | 18 | </div> |
diff --git a/client/src/app/videos/video-list/video-local.component.ts b/client/src/app/videos/video-list/video-local.component.ts index 03568b618..2fd82a940 100644 --- a/client/src/app/videos/video-list/video-local.component.ts +++ b/client/src/app/videos/video-list/video-local.component.ts | |||
@@ -27,8 +27,8 @@ export class VideoLocalComponent extends AbstractVideoList implements OnInit, On | |||
27 | protected notificationsService: NotificationsService, | 27 | protected notificationsService: NotificationsService, |
28 | protected authService: AuthService, | 28 | protected authService: AuthService, |
29 | protected location: Location, | 29 | protected location: Location, |
30 | private videoService: VideoService, | 30 | protected i18n: I18n, |
31 | private i18n: I18n | 31 | private videoService: VideoService |
32 | ) { | 32 | ) { |
33 | super() | 33 | super() |
34 | 34 | ||
diff --git a/client/src/app/videos/video-list/video-recently-added.component.ts b/client/src/app/videos/video-list/video-recently-added.component.ts index 5768d9fe0..8183357f8 100644 --- a/client/src/app/videos/video-list/video-recently-added.component.ts +++ b/client/src/app/videos/video-list/video-recently-added.component.ts | |||
@@ -25,8 +25,8 @@ export class VideoRecentlyAddedComponent extends AbstractVideoList implements On | |||
25 | protected location: Location, | 25 | protected location: Location, |
26 | protected notificationsService: NotificationsService, | 26 | protected notificationsService: NotificationsService, |
27 | protected authService: AuthService, | 27 | protected authService: AuthService, |
28 | private videoService: VideoService, | 28 | protected i18n: I18n, |
29 | private i18n: I18n | 29 | private videoService: VideoService |
30 | ) { | 30 | ) { |
31 | super() | 31 | super() |
32 | 32 | ||
diff --git a/client/src/app/videos/video-list/video-search.component.ts b/client/src/app/videos/video-list/video-search.component.ts index 35566a7bd..b6434f347 100644 --- a/client/src/app/videos/video-list/video-search.component.ts +++ b/client/src/app/videos/video-list/video-search.component.ts | |||
@@ -31,9 +31,9 @@ export class VideoSearchComponent extends AbstractVideoList implements OnInit, O | |||
31 | protected notificationsService: NotificationsService, | 31 | protected notificationsService: NotificationsService, |
32 | protected authService: AuthService, | 32 | protected authService: AuthService, |
33 | protected location: Location, | 33 | protected location: Location, |
34 | protected i18n: I18n, | ||
34 | private videoService: VideoService, | 35 | private videoService: VideoService, |
35 | private redirectService: RedirectService, | 36 | private redirectService: RedirectService |
36 | private i18n: I18n | ||
37 | ) { | 37 | ) { |
38 | super() | 38 | super() |
39 | 39 | ||
diff --git a/client/src/app/videos/video-list/video-trending.component.ts b/client/src/app/videos/video-list/video-trending.component.ts index 760470e8c..e56b749d1 100644 --- a/client/src/app/videos/video-list/video-trending.component.ts +++ b/client/src/app/videos/video-list/video-trending.component.ts | |||
@@ -25,8 +25,8 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit, | |||
25 | protected notificationsService: NotificationsService, | 25 | protected notificationsService: NotificationsService, |
26 | protected authService: AuthService, | 26 | protected authService: AuthService, |
27 | protected location: Location, | 27 | protected location: Location, |
28 | private videoService: VideoService, | 28 | protected i18n: I18n, |
29 | private i18n: I18n | 29 | private videoService: VideoService |
30 | ) { | 30 | ) { |
31 | super() | 31 | super() |
32 | 32 | ||