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!

Localization in Java Class

Maxime CarrierAug 2 2012 — edited Aug 3 2012
Hi all,

I have localization in my jspx pages with two PortalBundle.xlf & PortalBundle_fr.xlf files. It works fine. I use an ApplicationBean.java and a CustomPhaseListener.java classes. To call them, I use this variable set in the jspx pages:

<c:set var="portalBundle" value="#{adfBundle['portal.PortalBundle']}"/>

and this line to have the correct text:

<af:outputLabel value="#{portalBundle.LANGUAGE}"/>

In the project properties panel, I have set the ressourceBundle to portal.PortalBundle

But now I make modification on this label and I want to access the portalBundle from a java class. I have tried with these solutions:

ResourceBundle res = ResourceBundle.getBundle("PortalBundle");
String textEmployee = res.getString("LANGUAGE");

But the application cannot locate the ressourceBundle... and it takes my default locale instead of the locale of the ApplicationBean.

Thanks for your help!

PS: I used this video tutorial to localize my jspx pages: http://www.youtube.com/watch?v=ha6FzOkVc24
This post has been answered by Daniel Merchán on Aug 2 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 31 2012
Added on Aug 2 2012
6 comments
807 views