Skip to content
This repository was archived by the owner on Jun 1, 2020. It is now read-only.
This repository was archived by the owner on Jun 1, 2020. It is now read-only.

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

@rusekr

Description

@rusekr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions