INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

How to display in Hindi using Internationalisation through stuts 1.3

How to display in Hindi using Internationalisation through stuts 1.3

How to display in Hindi using Internationalisation through stuts 1.3

(OP)
Hi,

I am using struts 1.3 and try to build an web application to display in different locales. But I am unable to display the text in Hindi where as I am able to display in other languages like German, French, Italian. Can any one guide me how to develop that application to display in Hindi. If any can post the code or method I will be greatful to them.

I am using the follwing action class

public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception{

String language = (String) PropertyUtils.getSimpleProperty(form,"selectedItem");
System.out.println("language:"+language);
if (language.equals("english")){
HttpSession session = request.getSession();
session.setAttribute("org.apache.struts.action.LOCALE", Locale.ENGLISH);
System.out.println("###########english");
// return mapping.findForward("success");
}else if(language.equals("french")){
HttpSession session = request.getSession();
session.setAttribute("org.apache.struts.action.LOCALE", Locale.FRENCH);
System.out.println("###########french");
// return mapping.findForward("success");
}else if(language.equals("german")){
HttpSession session = request.getSession();
session.setAttribute("org.apache.struts.action.LOCALE", Locale.GERMAN);
System.out.println("###########german");

// return mapping.findForward("success");
}else if(language.equals("italian")){
HttpSession session = request.getSession();
session.setAttribute("org.apache.struts.action.LOCALE", Locale.ITALIAN);
System.out.println("###########italian");
// return mapping.findForward("success");
}
else if(language.equals("hindi")){
HttpSession session = request.getSession();
Locale locale = new Locale("hi","IN");
// session.setAttribute(ComponentConstants.LOCALE_KEY, locale);
// session.setAttribute("org.apache.struts.action.LOCALE",new Locale("hi"));

session.setAttribute("org.apache.struts.action.LOCALE", locale);
System.out.println("###########hindi");
// return mapping.findForward("success");
}
return mapping.findForward("success");

}

I tried properties file by converting the text in to unicode also.

Thanking you.
--raaja

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close