File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pros and Cons of Internationalization

 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,
I have to develop a web site which will be having 10 languages. Will it be better to use Internationalization or should i make different set of JSPs for each language.

Which approach will be better?
Plz recommend
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Internationalization. Duplication of effort/code is always a bad thing.
 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nathan Pruett:
Internationalization. Duplication of effort/code is always a bad thing.


Thanks Nathan Pruett,
Even i was thinking like this, but one of my friend told me that even in Internationalization we have to maintain different ResourceBundles.
Also i forgot to mention that the content of the website slightly differs with the language. Although the difference is 4-5% only.
Now I am trying to develop a prototype application using Internationalization.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you have to maintain different Resource Bundles for the parts of the website that are different in each language. However, you don't have to worry about things like changing the background color or fixing a line of messed up JavaScript in every version. A resource bundle contains the actual readable text of the site in one language. You can also put in anything else that is going to be different... references to different image filenames, etc. However, the layout of the page should stay the same across all languages. What do you mean by saying the content "slightly differs" with the language? If it is something really major, I guess you could have the filename of a JSP/HTML page for the different content and have your JSP do a dynamic include based off the resource bundle.

You should think of internationalization in this way... your JSP is the template, each resource bundle provides the resources needed to fill in the template and create a finished version of the page.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17616
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are pros and cons to having distinct locale-specific JSPs, but one thing you might consider is using Struts 1.1 and its application resource support.
 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't mentioned but i am using struts. I developed a small application and it worked fine, but the problem struts doesn't let me control, which language is to be displayed. i.e. It automatically takes input from the browser's language settings (probably it is set as request header). Can i somehow control it.
Actually user can never visit our site directly, he/she is redirected to our site from another site. And we recieve language preferences in a query string. And we have to use the values of query strings only, no matter what are client's browser settings
 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i was able to control Local setting, by just calling setLocale() method of Action class.

Thanks all
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic