File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes J2EE Internationalization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "J2EE Internationalization" Watch "J2EE Internationalization" New topic

J2EE Internationalization

Arockia Raj
Ranch Hand

Joined: Dec 08, 2006
Posts: 37
I am working for project where we need to internalize the j2EE application. We are not having any
Locale specific java classes. We need to internalize only JSP labels and JavaScript alert messages.
We finalized with keeping all the hard coding labels in a property file and retrieve the contents using java Resource Bundle Object. This I am seeing as a standard implementation across the entire projects.
But out project is for Chile where the language has to be of in Spanish and the application
Will be deployed in Chile and the users of the application are only from Chile i.e. Spanish users.
After seeing the code for resource bundle, it seems the labels will be fetched from property files
at runtime based on the locale object.
But in my case my locale is fixed and this is not runtime characteristics. I need this to happen at
Compile time since the locale is fixed .I thought of implementing this by introducing
pre-Compiling stage(through custom implementation) for jsp where the resource bundle entries are fetched and replaced for JSP labels before compiling the JSP.
Kindly share your valuable ideas regarding this.

Stefan Evans

Joined: Jul 06, 2005
Posts: 1580
You could do this, but do you really need to?
Is there a problem having all the translations done at runtime?
Premature optimization is the root of all evil.
Arockia Raj
Ranch Hand

Joined: Dec 08, 2006
Posts: 37
Thanks for your reply.

Since we are spending much effort on response time improvement,i thought of taking care at the initial stage itself.
I agree. Here's the link:
subject: J2EE Internationalization
It's not a secret anymore!