Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Internationalizing texts from jspx with parameters - JDeveloper 11.1.1.9 (Jsf 1.2)

Daniela VintuOct 29 2023 — edited Oct 29 2023

Hello,

We're in the process of preparing our project for Internationalization and got stuck on the following issue:

In faces-config we defined:

<resource-bundle>

  \<base-name>UIResources\</base-name> 

  \<var>res\</var> 

\</resource-bundle> 

We created the UIResources.properties and stated populating it with entries like:

action.create.label=&Create

In the jspx we used it like: <af:commandToolbarButton id="ctbAdd" textAndAccessKey="#{res['action.create.label']}"

All good, until we reached components that would require parameters

In the jspx we currently have something like <af:commandToolbarButton textAndAccessKey="Would you like to modify record number #{bindings.Id.inputValue} with value #{bindings.Value.inputValue}"…

In UiResources.properties we would have something like:

action.edit.label=Would you like to modify record number {0} with value {1}

But how to send parameters from jspx?

Because we use adf 11.1.1.9, jsf 1.2, we cannot use parameters.

An alternative would be to create a method for each property that would require internationalization, in the managed bean, that would retrieve the value from the resources file, but would prefere not to do this, as our project is really really huge, with over 1300 jspx - and that would be really complicated to define all the translatable properties in backing beans - I would like to obtain something from the jspx (I tried setting attributes on the component, to define the parameters, but got nowhere)

Any suggestion?

Thanks

This post has been answered by Dimitar Dimitrov on Oct 31 2023
Jump to Answer
Comments
Post Details
Added on Oct 29 2023
4 comments
355 views