This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Oct 20, 2011, 1:05 PM
10 Posts

Custom component and internationalization

  • Category: Custom JSF code (Eclipse IDE)
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 2
Hello,
 
I created a custom component (by adding proper java classes to src folder and configuration to WebContent/WEB-INFO inside nsf). It works good when used inside xpage.
The problem is when I try to enable localization in database and translate it. Every part of application except for custom component and its content is translated properly.
It looks as if I did not marked somehow the custom component for translation?
 
Can anybody tell me how to change component so it would be transable ?
Oct 20, 2011, 5:38 PM
135 Posts
Re: Custom component and internationalization

Your code is not translated, you need to get the localized strings in your code. In SSJS it's easy, like strings["Title"].

In 8.5.3 it's easier to use the new Java element. In Java I've used doc.generateXML() to get the content of the .properties file design element. Not sure if it works with variableResolver. That would be much easier:
 
FacesContext context = FacesContext.getCurrentInstance();
String strTitle = context.getApplication().getVariableResolver().resolveVariable(context, "strings['Title']"); 
 
Or you could just pass all strings from SSJS.
Oct 21, 2011, 9:51 AM
10 Posts
Re: Custom component and internationalization
Hello,
Thanks for help. Do You know maybe how to turn on translation on attributes ? For example:
 
 <namespage:componentX someAttribute="I want thins in German !"></namespage:componentX>
 
I know that I cane also use Your method here (using bundle and computed js expression)  but I assume it should be possible to force xpages to use the default translation mechanic here, right?

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal