Message Boards

Liferay React portlet with language properties

Anonymous Anonymous, modified 2 Years ago.

Liferay React portlet with language properties

Regular Member Posts: 127 Join Date: 9/16/19 Recent Posts
Hello!

I'm developing React portlet with https://dev.liferay.com/develop/reference/-/knowledge_base/7-0/npm-react-portlet-template

I can see that there is language.properties in folder structure. Any idea how i can use it in jsx code same way as in JSF i18n internationalization?

Thanks in advance!

Best regards,


Jani
thumbnail
Christoph Rabel, modified 6 Years ago.

RE: Liferay React portlet with language properties

Liferay Legend Posts: 1554 Join Date: 9/24/09 Recent Posts
I'm interested in that too.

We use vue,js mostly and currently have tried two approaches:
1) Use a template context contributor to put them into the theme.
The contributor simply writes the translations into javascript variables and we read them later. Works quite well but has of course some obvious disadvantages.

2) We have a CXF rest service that simply returns the requested texts as a json array.

But maybe there is a better approach.