jQuery in Action, 2nd edition*
The moose likes JSP and the fly likes Pros and Cons of Internationalization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Pros and Cons of Internationalization" Watch "Pros and Cons of Internationalization" New topic
Author

Pros and Cons of Internationalization

Prakash Dwivedi
Ranch Hand

Joined: Sep 28, 2002
Posts: 452
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


Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Internationalization. Duplication of effort/code is always a bad thing.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Prakash Dwivedi
Ranch Hand

Joined: Sep 28, 2002
Posts: 452
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

Joined: Oct 18, 2000
Posts: 4121

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

Joined: Jun 25, 2001
Posts: 15956
    
  19

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Prakash Dwivedi
Ranch Hand

Joined: Sep 28, 2002
Posts: 452
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

Joined: Sep 28, 2002
Posts: 452
i was able to control Local setting, by just calling setLocale() method of Action class.

Thanks all
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pros and Cons of Internationalization
 
Similar Threads
Internationalization in the Model
Internationlization using JSTL
Internationalization of string
String and internationalization
Declare a PUBLIC Result Set