I dont have any code!
What you must do is create the internationalisation (i18n) bundles beforehand.
You
can also create properties text file for each of your locales. Then have a list
locales
to preload. THis should then load your bundles. Consult a good J2SE book. "Core
Java"
Volume I ( or is II ? )
String [] locales ={ "en_gb", "de_de", "fr_fr", "fr_ca" , ... };
Hashmap map = new Hashmap;
for (int i=0; <locales.length ; ++i ) {
ResourceBundle bundle
= Resounce.getBundle( Locale.getLocale( locale[i] ) , "property_file" } ;
map.add( locale[i] , bundle );
}
I think somehting like this would work.
--
Peter Pilgrim
Welcome to the "Me Too" generation.
---------------------------------------- Message History
----------------------------------------
09/26/2000 09:31 AM
(subscript: Martin De Miguel Lillo@TSM)
Thanks for answer : I don't know how i can do this, would you please send a code
with this idea?.
Thank you in advance.
-----------------------------------------
wHY dont you preload and cache all the available resource bundles and
then hash map the language to the resource bundle. Use the locale `en_gb'
to map to your resource bundle in a shared data object.
--
Peter Pilgrim
Welcome to the "Me Too" generation.
---------------------------------------- Message History
----------------------------------------
Hi all,
I want to internationalizate a website and i have two ways to do it :
1.- Put ResourceBundle into session and gets in all servlets : This is the
easier way but parameter ResourceBundle can be too big to store into session and
it can overload server.
2.- Put language into session and gets ResourceBundle in each servlet : Better
for server but much cost to repeat in all servlets same code.
What you think is better way?
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html