diff options
Diffstat (limited to 'client/src/app/videos/+video-edit')
6 files changed, 55 insertions, 48 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 | ) |