/bpmn-js-i18n

Translate BPMN Diagrams Using bpmn-js and the BPMN 2.0 Extension for Internationalization

Primary LanguageJavaScriptMIT LicenseMIT

bpmn-js-i18n 🌎

CI

A bpmn-js extension for translating BPMN diagrams using the BPMN 2.0 extension for internationalization (I18n).

Screencast

Installation

Install via npm.

npm install @philippfromme/bpmn-js-i18n

Add as additional module to bpmn-js.

Modeler

import BpmnModeler from 'bpmn-js/lib/Modeler';
import BpmnInternationalizationModule from 'bpmn-js-i18n';

import BpmnI18nSchema from 'bpmn-i18n-moddle/resources/bpmn-i18n.json';

const modeler = new BpmnModeler({
  container: '#canvas',
  additionalModules: [
    BpmnInternationalizationModule
  ],
  moddleExtensions: {
    i18n: BpmnI18nSchema
  }
});

Viewer

import BpmnViewer from 'bpmn-js/lib/NavigatedViewer';
import BpmnInternationalizationModule from 'bpmn-js-i18n/lib/viewer';

import BpmnI18nSchema from 'bpmn-i18n-moddle/resources/bpmn-i18n.json';

const viewer = new BpmnViewer({
  container: '#canvas',
  additionalModules: [
    BpmnInternationalizationModule
  ],
  moddleExtensions: {
    i18n: BpmnI18nSchema
  }
});

Build and Run

Prepare the project by installing all dependencies:

npm install

Then, depending on your use-case you may run any of the following commands:

# build and test
npm run all

# start example
npm start

# run tests in watch mode
npm run dev

Licence

MIT