The Workflow text system

The workflow text system allows you to configure the text which appears in the user interface.

You add text to the system with the text() function on the Workflow object, which takes a dictionary of text names to strings, for example

EgWorkflow.text({
    "status:approved": "Approved",
    "status:rejected": "Rejected",
    "status:wait_head": "Waiting for NAME(Head of Department)"
});

You can call text() as many times as you need.

All text strings are subject to interpolation by textInterpolate() functions, and can be translated using the platform’s internationalisation features.

By default, the NAME(name) interpolation calls the NAME() function to translate names of things. Note there are no quotes within the brackets, as in the example above. See String interpolation for details.

You can retrieve the text string from the name by calling getTextMaybe() on an instance of that workflow.

Internationalisation and translation

After a string has been found by the text system, it is translated using the workflow category of internationalisation resources, using the implementing plugin’s resources.

Translation for internationalisation happens before interpolation.

Searching for strings

To avoid having to set lots of strings for every possible case, the text system has a list of string it’ll search. The most specific string will be used.

In the documented search paths, placeholders will be used:

  • STATE – name of a state
  • TRANSITION – name of a transition

Search paths for text

NAME() customisation
Notification emails
States and transitions
Timeline
Transition form
Transition UI
UI