Localization in a Fusion app

Hello all,

We are testing an application in Fusion and I can’t seem to find anything about localization in a Fusion app. I do see there is solution for a java Flow application, but would that solution also work in Fusion?

Thanks!

Hi,

There is nothing specifically included in Vaadin Fusion for the localization.
To translate the captions, you can use lit-translate npm package.

Here is an example: https://github.com/jcgueriaud1/fusion-grid-column-configurator-example/blob/main/frontend/views/helloworld/hello-world-view.ts#L14

The documentation of the package is quite good: https://github.com/andreasbm/lit-translate

There is also this solution (I didn’t try it and it’s still in active development): https://www.npmjs.com/package/@lit/localize

I have written Java utility that transforms translation items in an Excel sheet to the lit-translate JSON format.

This allows you to manage and automatically translate your items in Google Sheets and then quickly transform to JSON. Not flawless, but definitely a time saver.

Happy to share if anyone is interested.

Thanks for your replies - we will take a closer look at lit-translate.

Hi,

I’ve created an example here: https://github.com/jcgueriaud1/vaadin-multilanguage-app

The validation is not working , there is an open ticket: https://github.com/vaadin/flow/issues/10688

Thanks, that is awesome!
I will check out the example.