Evaluation Options Editor API Methods
setLabelBundle()
Overrides the default UI labels with custom labels.
You would want to use this method so that you can customize the editor's text, for example, to translate the labels or to match the button text to your application.
Labels you do not provide keep their current text. Each call adds to the overrides from earlier calls, and a label stays overridden until you override it again. To restore a default label, set it to its default text.
Examples
// Change the text of the Cancel button
await editor.setLabelBundle({
labels: {
'actions.cancel': 'Go back'
}
});
Arguments
-
options object
Object containing the labels to override the default UI labels.
The following properties are supported.
-
labels object
The labels to override. Each key is a label key and each value is the text to display. Labels you do not provide keep their current text.
Note Overrides persist between calls. Each call adds to the overrides from earlier calls, and a label stays overridden until you override it again. To restore a default label, set it to its default text. The labels apply to every evaluation options editor on the page.
See the full list of properties for the labels that you can customize.
-
Return value
Type Promise
Resolves when the label bundle is set.