aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/plugins
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-29 14:08:07 +0100
committerChocobozzz <me@florianbigard.com>2021-12-29 14:08:07 +0100
commitfb3c9e2bf5b45d6d283cea4d55cc0d49eb58e3cb (patch)
tree251e39490e83b6a0e40c25871188628e62819fa8 /client/src/app/+admin/plugins
parent2accfdd8ecd092de7e8c71fbd1235e139ad29832 (diff)
downloadPeerTube-fb3c9e2bf5b45d6d283cea4d55cc0d49eb58e3cb.tar.gz
PeerTube-fb3c9e2bf5b45d6d283cea4d55cc0d49eb58e3cb.tar.zst
PeerTube-fb3c9e2bf5b45d6d283cea4d55cc0d49eb58e3cb.zip
Translate plugin settings
Diffstat (limited to 'client/src/app/+admin/plugins')
-rw-r--r--client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts18
1 files changed, 1 insertions, 17 deletions
diff --git a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts
index 402bef1ea..1a40f6c65 100644
--- a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts
+++ b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts
@@ -126,25 +126,9 @@ export class PluginShowInstalledComponent extends FormReactive implements OnInit
126 126
127 private async translateSettings (settings: RegisterServerSettingOptions[]) { 127 private async translateSettings (settings: RegisterServerSettingOptions[]) {
128 for (const setting of settings) { 128 for (const setting of settings) {
129 for (const key of [ 'label', 'html', 'descriptionHTML' ]) { 129 await this.pluginService.translateSetting(this.npmName, setting)
130 if (setting[key]) setting[key] = await this.pluginService.translateBy(this.npmName, setting[key])
131 }
132
133 if (Array.isArray(setting.options)) {
134 const newOptions = []
135
136 for (const o of setting.options) {
137 newOptions.push({
138 value: o.value,
139 label: await this.pluginService.translateBy(this.npmName, o.label)
140 })
141 }
142
143 setting.options = newOptions
144 }
145 } 130 }
146 131
147 return settings 132 return settings
148 } 133 }
149
150} 134}