How to add i18n for web applications(cockpit,admin)?

Hi there,

Read from the blog I know that cockpit and admin support i18n from v7.8, I tried it myself, however, I meet trouble during the test, maybe I didn’t understand how to do it. What I was doing as follows:

1.Regarding i18n for cockpit and admin, I must uncomment the locales block in the admin/client/scripts/config.js first, then add my locale translation file zh.json in the locales directory. is there any way that not modify config.js to let the zh.json take effect?
2. How to add my locale files for camunda-commons-ui easily? what I mean is it possible to add i18n for camunda-commons-ui, but not compile camunda-webapp project again.
3. Actually, my goal is don’t change any code of camunda-web and comunda-commons-ui, just add some new files as a jar to support my locale language - Open - close principle, open for extending, close for changing.

Hi @samuelwang,

1.Regarding i18n for cockpit and admin, I must uncomment the locales block in the admin/client/scripts/config.js first, then add my locale translation file zh.json in the locales directory. is there any way that not modify config.js to let the zh.json take effect?

Adding the locales config in the config.js is mandatory for you translations to take effect. Otherwise, the app can’t know which locales you are supporting?

  1. How to add my locale files for camunda-commons-ui easily? what I mean is it possible to add i18n for camunda-commons-ui, but not compile camunda-webapp project again.

You can add your locales for camunda-commons-ui within the locales of cockpit or admin.

  1. Actually, my goal is don’t change any code of camunda-web and comunda-commons-ui, just add some new files as a jar to support my locale language - Open - close principle, open for extending, close for changing.

Except the config.js files, you don’t have to change any code and you can just add your locales once you configured them properly.

Does this help you?

Best Regards,
Seif

Yes, thanks so much.