How to dynamically change i18n

When initializing Modeler, a language has already been set. How can I dynamically switch the display language now? For example, en ->fr, fr ->en

It’s not possible to change the language after initialization. Within your custom translate you’d need a switch and also retrigger the rendering of all parts of the UI that have translatable text. That’s not supported out of the box.

Is there a general implementation method or steps?

You can indicate that the language changed via i18n.changed().

This will trigger UI updates on a best effort basis.

Do you need to redo Modeler ()? I have already initialized Modeler and initialized a language in it. Now I need to dynamically switch to another language.

https://codesandbox.io/p/devbox/bpmn-i18n-wqy46g?layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clzuy0xid00073b6i59nom71h%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clzuy0xid00023b6i31nhu6tz%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clzuy0xid00043b6icpidldmi%2522%257D%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clzuy0xid00063b6i6pnggwgx%2522%257D%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clzuy0xid00023b6i31nhu6tz%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clzuy0xid00013b6iwat9l8ud%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522filepath%2522%253A%2522%252FREADME.md%2522%252C%2522state%2522%253A%2522IDLE%2522%257D%255D%252C%2522id%2522%253A%2522clzuy0xid00023b6i31nhu6tz%2522%252C%2522activeTabId%2522%253A%2522clzuy0xid00013b6iwat9l8ud%2522%257D%252C%2522clzuy0xid00063b6i6pnggwgx%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clzuy0xid00053b6ivc4wsh8k%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_PORT%2522%252C%2522taskId%2522%253A%2522pnpm%2520run%2520dev%2522%252C%2522port%2522%253A5173%257D%255D%252C%2522id%2522%253A%2522clzuy0xid00063b6i6pnggwgx%2522%252C%2522activeTabId%2522%253A%2522clzuy0xid00053b6ivc4wsh8k%2522%257D%252C%2522clzuy0xid00043b6icpidldmi%2522%253A%257B%2522id%2522%253A%2522clzuy0xid00043b6icpidldmi%2522%252C%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clzuy0xid00033b6i52kchqdl%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522pnpm%2520run%2520dev%2522%257D%255D%252C%2522activeTabId%2522%253A%2522clzuy0xid00033b6i52kchqdl%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D