diff options
author | Chocobozzz <me@florianbigard.com> | 2020-08-12 10:40:04 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-08-14 10:28:30 +0200 |
commit | 66357162f8e1227495f09bd4f68446aad7071c6d (patch) | |
tree | 7d4429506deb512b2fe1d0267f38a28cda20af55 /client/src/app/shared/shared-main/video | |
parent | 8c360747995e17eb5520e22fc3d7bd4c3d26eeee (diff) | |
download | PeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.tar.gz PeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.tar.zst PeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.zip |
Migrate to $localize
* Remove i18n polyfill to translate things in components
* Reduce bundle sizes
* Improve runtime perf
* Reduce a lot the time to make a full client build
* Reduce client build complexity
* We don't need a service to translate things anymore (so we will be able to translate title pages etc)
Unfortunately we may loose some translations in the migration process.
I'll put a message on weblate to notify translators
Diffstat (limited to 'client/src/app/shared/shared-main/video')
-rw-r--r-- | client/src/app/shared/shared-main/video/video.service.ts | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts index 978f775bf..b01e919aa 100644 --- a/client/src/app/shared/shared-main/video/video.service.ts +++ b/client/src/app/shared/shared-main/video/video.service.ts | |||
@@ -4,7 +4,6 @@ import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http' | |||
4 | import { Injectable } from '@angular/core' | 4 | import { Injectable } from '@angular/core' |
5 | import { ComponentPaginationLight, RestExtractor, RestService, ServerService, UserService } from '@app/core' | 5 | import { ComponentPaginationLight, RestExtractor, RestService, ServerService, UserService } from '@app/core' |
6 | import { objectToFormData } from '@app/helpers' | 6 | import { objectToFormData } from '@app/helpers' |
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
8 | import { | 7 | import { |
9 | FeedFormat, | 8 | FeedFormat, |
10 | NSFWPolicyType, | 9 | NSFWPolicyType, |
@@ -15,11 +14,11 @@ import { | |||
15 | Video as VideoServerModel, | 14 | Video as VideoServerModel, |
16 | VideoConstant, | 15 | VideoConstant, |
17 | VideoDetails as VideoDetailsServerModel, | 16 | VideoDetails as VideoDetailsServerModel, |
17 | VideoFileMetadata, | ||
18 | VideoFilter, | 18 | VideoFilter, |
19 | VideoPrivacy, | 19 | VideoPrivacy, |
20 | VideoSortField, | 20 | VideoSortField, |
21 | VideoUpdate, | 21 | VideoUpdate |
22 | VideoFileMetadata | ||
23 | } from '@shared/models' | 22 | } from '@shared/models' |
24 | import { environment } from '../../../../environments/environment' | 23 | import { environment } from '../../../../environments/environment' |
25 | import { Account, AccountService } from '../account' | 24 | import { Account, AccountService } from '../account' |
@@ -48,8 +47,7 @@ export class VideoService implements VideosProvider { | |||
48 | private authHttp: HttpClient, | 47 | private authHttp: HttpClient, |
49 | private restExtractor: RestExtractor, | 48 | private restExtractor: RestExtractor, |
50 | private restService: RestService, | 49 | private restService: RestService, |
51 | private serverService: ServerService, | 50 | private serverService: ServerService |
52 | private i18n: I18n | ||
53 | ) {} | 51 | ) {} |
54 | 52 | ||
55 | getVideoViewUrl (uuid: string) { | 53 | getVideoViewUrl (uuid: string) { |
@@ -339,19 +337,19 @@ export class VideoService implements VideosProvider { | |||
339 | const base = [ | 337 | const base = [ |
340 | { | 338 | { |
341 | id: VideoPrivacy.PRIVATE, | 339 | id: VideoPrivacy.PRIVATE, |
342 | description: this.i18n('Only I can see this video') | 340 | description: $localize`Only I can see this video` |
343 | }, | 341 | }, |
344 | { | 342 | { |
345 | id: VideoPrivacy.UNLISTED, | 343 | id: VideoPrivacy.UNLISTED, |
346 | description: this.i18n('Only shareable via a private link') | 344 | description: $localize`Only shareable via a private link` |
347 | }, | 345 | }, |
348 | { | 346 | { |
349 | id: VideoPrivacy.PUBLIC, | 347 | id: VideoPrivacy.PUBLIC, |
350 | description: this.i18n('Anyone can see this video') | 348 | description: $localize`Anyone can see this video` |
351 | }, | 349 | }, |
352 | { | 350 | { |
353 | id: VideoPrivacy.INTERNAL, | 351 | id: VideoPrivacy.INTERNAL, |
354 | description: this.i18n('Only users of this instance can see this video') | 352 | description: $localize`Only users of this instance can see this video` |
355 | } | 353 | } |
356 | ] | 354 | ] |
357 | 355 | ||