I can't figure out how to update an enum field with new options that have been translated. This works to create the field with translated options:
The translations are in custom/Espo/Modules/Module/Resources/i18n/en_US/Module.json. The initial options are translated as expected. The following code updates the list of options:
However, the new options are not translated. I can't figure out how to replace the options with translated labels.
Code:
this.createField('mode', 'views/fields/multi-enum', { options: ["foo", "bar", "baz"], translation: 'Module.modes', }, null, null, { labelText: this.translate('mode', 'labels', 'Module') })
Code:
this.listenTo(this.model, 'change:mode', (model, value, o) => { newOptions = ["foo1", "bar1", "baz1"] this.setFieldOptionList("period", newOptions) this.trigger('change') });
Comment