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/+videos/+video-edit/shared/video-edit.component.ts | |
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/+videos/+video-edit/shared/video-edit.component.ts')
-rw-r--r-- | client/src/app/+videos/+video-edit/shared/video-edit.component.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts index ba3b7c96a..050b6d931 100644 --- a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts +++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts | |||
@@ -7,7 +7,6 @@ import { removeElementFromArray } from '@app/helpers' | |||
7 | import { FormReactiveValidationMessages, FormValidatorService, SelectChannelItem, VideoValidatorsService } from '@app/shared/shared-forms' | 7 | import { FormReactiveValidationMessages, FormValidatorService, SelectChannelItem, VideoValidatorsService } from '@app/shared/shared-forms' |
8 | import { InstanceService } from '@app/shared/shared-instance' | 8 | import { InstanceService } from '@app/shared/shared-instance' |
9 | import { VideoCaptionEdit, VideoEdit, VideoService } from '@app/shared/shared-main' | 9 | import { VideoCaptionEdit, VideoEdit, VideoService } from '@app/shared/shared-main' |
10 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
11 | import { ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models' | 10 | import { ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models' |
12 | import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service' | 11 | import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service' |
13 | import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component' | 12 | import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component' |
@@ -63,7 +62,6 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
63 | private serverService: ServerService, | 62 | private serverService: ServerService, |
64 | private instanceService: InstanceService, | 63 | private instanceService: InstanceService, |
65 | private i18nPrimengCalendarService: I18nPrimengCalendarService, | 64 | private i18nPrimengCalendarService: I18nPrimengCalendarService, |
66 | private i18n: I18n, | ||
67 | private ngZone: NgZone | 65 | private ngZone: NgZone |
68 | ) { | 66 | ) { |
69 | this.calendarLocale = this.i18nPrimengCalendarService.getCalendarLocale() | 67 | this.calendarLocale = this.i18nPrimengCalendarService.getCalendarLocale() |
@@ -137,8 +135,8 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
137 | .subscribe(res => { | 135 | .subscribe(res => { |
138 | this.videoLanguages = res.languages | 136 | this.videoLanguages = res.languages |
139 | .map(l => res.about.instance.languages.includes(l.id) | 137 | .map(l => res.about.instance.languages.includes(l.id) |
140 | ? { ...l, group: this.i18n('Instance languages'), groupOrder: 0 } | 138 | ? { ...l, group: $localize`Instance languages`, groupOrder: 0 } |
141 | : { ...l, group: this.i18n('All languages'), groupOrder: 1 }) | 139 | : { ...l, group: $localize`All languages`, groupOrder: 1 }) |
142 | .sort((a, b) => a.groupOrder - b.groupOrder) | 140 | .sort((a, b) => a.groupOrder - b.groupOrder) |
143 | }) | 141 | }) |
144 | 142 | ||
@@ -148,8 +146,8 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
148 | if (this.schedulePublicationPossible) { | 146 | if (this.schedulePublicationPossible) { |
149 | this.videoPrivacies.push({ | 147 | this.videoPrivacies.push({ |
150 | id: this.SPECIAL_SCHEDULED_PRIVACY, | 148 | id: this.SPECIAL_SCHEDULED_PRIVACY, |
151 | label: this.i18n('Scheduled'), | 149 | label: $localize`Scheduled`, |
152 | description: this.i18n('Hide the video until a specific date') | 150 | description: $localize`Hide the video until a specific date` |
153 | }) | 151 | }) |
154 | } | 152 | } |
155 | }) | 153 | }) |