Guide: i18n

Every user-facing string the editor itself renders — status messages, the "insert cartography object" search input's placeholder — is overridable via the messages option. Unset keys fall back to the bundled French defaults. See the full key list in the API reference for what each one is used for and which two keys aren't consumed by the editor itself (reserved for a host's own validation).

Overriding a few strings

You don't need to provide every key — only the ones you want to change:

createBpmnEditor(container, {
  messages: {
    welcome: 'Load a file to get started',
    noMatch: 'Nothing found',
  },
});

Full English translation

import { createBpmnEditor } from '@sourcentis/bpmn-editor';
import type { BpmnEditorMessages } from '@sourcentis/bpmn-editor';

const en: BpmnEditorMessages = {
  welcome:           '👋 Welcome! Load a BPMN file to get started',
  saveSuccess:       '✓ Diagram saved',
  saveError:         'Could not save the diagram.',
  saveNameRequired:  'The diagram name is required.',
  exportError:       '✗ Could not generate the BPMN export',
  loadSuccess:       '✓ File loaded successfully',
  loadError:         '✗ Could not load this file',
  xmlParseError:     'Could not parse this XML file',
  filterPlaceholder: 'Filter...',
  filterAriaLabel:   'Filter elements',
  noMatch:           'No match.',
};

createBpmnEditor(container, { messages: en });

What isn't covered by messages

Two categories of text are not part of messages, deliberately:

  • BPMN element names in the "change element type" (wrench) picker — "Task", "Gateway", "Start event", and so on. These are drawn from @maxgraph/core's own vocabulary and are currently English-only; there's no separate translation layer for them yet.
  • title/aria-label attributes on toolbar and contextual-menu icon buttons ("Zoom in", "Delete", …) — these are short accessibility labels tied to the built-in ui: 'default' chrome, not exposed through messages. If you need them translated, mount with ui: 'none' and build your own toolbar with whatever labels you want.