rjsf-material-ui icon indicating copy to clipboard operation
rjsf-material-ui copied to clipboard

How to translate "Add item" label? Where to put props.label for AddButton widget.

Open rusekr opened this issue 5 years ago • 0 comments

Hello! Tested with no luck as

import { withTheme } from 'react-jsonschema-form';
import { Theme as MuiTheme } from 'rjsf-material-ui';

const MuiForm = withTheme(MuiTheme);

  finalSchema.buttonLabel = "my label";
  finalSchema['ui:options'] = { addButtonLabel: 'my label' };

And later:

        <MuiForm
          schema={props.schema}
          ref={props.formRef}
          uiSchema={finalSchema}
...

I'am getting default hardcoded "+add Item" anyway for schemes supporting arrays if items.

On examples page https://cybertec-postgresql.github.io/rjsf-material-ui/ here are "Custom array" example and "Arrays" example. In latter to translate button I need to put ui:options.addButtonLabel to every parameter to translate. But can I use something like "default label" for any parameter.

Use case - I need to just translate default "add item". Not customize for parameters.

rusekr avatar Feb 13 '20 12:02 rusekr