diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-29 14:08:07 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-29 14:08:07 +0100 |
commit | fb3c9e2bf5b45d6d283cea4d55cc0d49eb58e3cb (patch) | |
tree | 251e39490e83b6a0e40c25871188628e62819fa8 /client/src/app/+videos | |
parent | 2accfdd8ecd092de7e8c71fbd1235e139ad29832 (diff) | |
download | PeerTube-fb3c9e2bf5b45d6d283cea4d55cc0d49eb58e3cb.tar.gz PeerTube-fb3c9e2bf5b45d6d283cea4d55cc0d49eb58e3cb.tar.zst PeerTube-fb3c9e2bf5b45d6d283cea4d55cc0d49eb58e3cb.zip |
Translate plugin settings
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r-- | client/src/app/+videos/+video-edit/shared/video-edit.component.ts | 6 |
1 files changed, 5 insertions, 1 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 a03005bcb..8ce36121d 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 | |||
@@ -22,6 +22,7 @@ import { | |||
22 | import { FormReactiveValidationMessages, FormValidatorService } from '@app/shared/shared-forms' | 22 | import { FormReactiveValidationMessages, FormValidatorService } from '@app/shared/shared-forms' |
23 | import { InstanceService } from '@app/shared/shared-instance' | 23 | import { InstanceService } from '@app/shared/shared-instance' |
24 | import { VideoCaptionEdit, VideoEdit, VideoService } from '@app/shared/shared-main' | 24 | import { VideoCaptionEdit, VideoEdit, VideoService } from '@app/shared/shared-main' |
25 | import { PluginInfo } from '@root-helpers/plugins-manager' | ||
25 | import { | 26 | import { |
26 | HTMLServerConfig, | 27 | HTMLServerConfig, |
27 | LiveVideo, | 28 | LiveVideo, |
@@ -37,6 +38,7 @@ import { VideoEditType } from './video-edit.type' | |||
37 | 38 | ||
38 | type VideoLanguages = VideoConstant<string> & { group?: string } | 39 | type VideoLanguages = VideoConstant<string> & { group?: string } |
39 | type PluginField = { | 40 | type PluginField = { |
41 | pluginInfo: PluginInfo | ||
40 | commonOptions: RegisterClientFormFieldOptions | 42 | commonOptions: RegisterClientFormFieldOptions |
41 | videoFormOptions: RegisterClientVideoFieldOptions | 43 | videoFormOptions: RegisterClientVideoFieldOptions |
42 | } | 44 | } |
@@ -294,7 +296,7 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
294 | }) | 296 | }) |
295 | } | 297 | } |
296 | 298 | ||
297 | private updatePluginFields () { | 299 | private async updatePluginFields () { |
298 | this.pluginFields = this.pluginService.getRegisteredVideoFormFields(this.type) | 300 | this.pluginFields = this.pluginService.getRegisteredVideoFormFields(this.type) |
299 | 301 | ||
300 | if (this.pluginFields.length === 0) return | 302 | if (this.pluginFields.length === 0) return |
@@ -305,6 +307,8 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
305 | const pluginDefaults: any = {} | 307 | const pluginDefaults: any = {} |
306 | 308 | ||
307 | for (const setting of this.pluginFields) { | 309 | for (const setting of this.pluginFields) { |
310 | await this.pluginService.translateSetting(setting.pluginInfo.plugin.npmName, setting.commonOptions) | ||
311 | |||
308 | const validator = (control: AbstractControl): ValidationErrors | null => { | 312 | const validator = (control: AbstractControl): ValidationErrors | null => { |
309 | if (!setting.commonOptions.error) return null | 313 | if (!setting.commonOptions.error) return null |
310 | 314 | ||