this.form.patchValue(settingsValues)
- setTimeout(() => this.hooks.runAction('action:admin-plugin-settings.init', 'admin-plugin', { npmName: this.npmName }))
+ this.hooks.runAction('action:admin-plugin-settings.init', 'admin-plugin', { npmName: this.npmName })
}
private getSetting (name: string) {
private async translateSettings (settings: RegisterServerSettingOptions[]) {
for (const setting of settings) {
- for (const key of [ 'label', 'html', 'descriptionHTML' ]) {
- if (setting[key]) setting[key] = await this.pluginService.translateBy(this.npmName, setting[key])
- }
-
- if (Array.isArray(setting.options)) {
- const newOptions = []
-
- for (const o of setting.options) {
- newOptions.push({
- value: o.value,
- label: await this.pluginService.translateBy(this.npmName, o.label)
- })
- }
-
- setting.options = newOptions
- }
+ await this.pluginService.translateSetting(this.npmName, setting)
}
return settings
}
-
}