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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 1016
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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: J2EE Internationalization
Similar Threads
Including html files outside the tomcat webapps directory
A Strange behavior about Java Resource Bundle
Help required in implementing internationalization in JSP
Internationlization JSP Labels
Need Help regarding Internationalization in JSF