cancel
Showing results for 
Search instead for 
Did you mean: 

Localization (i18n) not working for Fiori Elements UI

former_member66
Advisor
Advisor
0 Kudos

Hi Community!

I am trying to externalize my texts to text bundles in a CAP Java application.

Therefore I followed this guide: https://cap.cloud.sap/docs/guides/i18n

I placed the text bundles like this within the project:

_i18n/i18n.properties
db/model.cds
srv/cds/annotations.cds
srv/cds/my-service.cds
...

However the generated Fiori Elements UI does not seem to recognize any of the texts. Is the i18n file in the wrong place or is there something else that needs to be added?

Thanks.

gregorw
Active Contributor
0 Kudos

Have you checked that the text appear in the metadata of your service?

former_member66
Advisor
Advisor
0 Kudos

The issue seems to be connected to the oData-v2-Adapter.

With v4 the text are fine, however when using the v2 endpoint, they do not get recognized.

Is there a different location for i18n files when using the oData-v2-Adapter or are there other adjustments needed to make it work?

gregorw
Active Contributor
0 Kudos

Do you see this issue also in my demo repository bookshop-demo where I have V2 and also V4 UI's?

former_member66
Advisor
Advisor
0 Kudos

No, but I am not sure this is applicable to my issue, as it uses a different approach (Node.js service instead of Java). In your repository you are enabling oData v2 via the proxy adapter. My service uses the CDS oData v2 Adapter.

Accepted Solutions (1)

Accepted Solutions (1)

former_member66
Advisor
Advisor

Solved my issue by adjusting the additional cds compile command that is needed for the oData v2 Adapter. Adding the language option -l all solved the problem.

<command>compile ${project.basedir} -s all -2 edmx-v2 -l all -o ${project.basedir}/src/main/resources/edmx/v2</command>

This way not only the default language is available, but all the languages, which is need for the Fiori Elements UI.

Answers (0)