bpmn-io / properties-panel

Library for creating bpmn-io properties panels.
MIT License
28 stars 20 forks source link

Make core components translatable #43

Open pinussilvestrus opened 3 years ago

pinussilvestrus commented 3 years ago

What should we do?

Currently, every component that goes inside src/properties-panel is not translatable. We use the translate service inside the BPMN part, but the core parts are currently not an injectable didi service.

We could add a translate function to the props of the PropertiesPanel component..

Alternatively, we could make the whole thing a didi service as well, but that would break the concept of having the core as a generic component catalog only.

Why should we do it?

Our UI should be translatable altogether, not only the properties.

barmac commented 3 years ago

Alternative: Any labels/placeholders could be passed via props.

import { useService } from './hooks';

function BpmnPropertyComponent(props) {
  const translate = useService('translate');

  return <TextInput placeholder={ translate('empty') } />;
}