You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Santosh Joshi <sa...@apsolve.com> on 2004/02/26 14:25:18 UTC

Internationalization Help

All,

I am sure Tomcat can be internationalized to accept internationalized
character encoding, but the trouble is I do not know HOW?

Could someone point me to a quick HOW-TO guide?

BTW I am planning to use 4.1.30 (or later version) for this purpose. 

Any help very much appreciated.

Regards,

Santosh

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Internationalization Help

Posted by Nimish <ni...@yahoo.com>.
> All,
> 
> I am sure Tomcat can be internationalized to accept
> internationalized
> character encoding, but the trouble is I do not know
> HOW?
> 
> Could someone point me to a quick HOW-TO guide?
> 
> BTW I am planning to use 4.1.30 (or later version)
> for this purpose. 
> 
> Any help very much appreciated.
> 
> Regards,
> 
> Santosh
> 

You need to use ResourceBundle with properties files
that are specific to various locales. Keep your
default locale strings in a file named something like
<app_name>.properties in the WEB-INF/classes directory
of your application in Tomcat's webapps. You can also
keep other locale files in
<app_name>_<locale>.properties. [For example,
<app_name>_de.properties for German strings,
<app_name>_fr.properties for French strings, etc.] 

Then you can load the strings using 

ResourceBundle rb =
ResourceBundle.getBundle("<app-name>",
request.getLocale());

That will pick the correct properties file depending
on your browser locale. (This can be changed by
changing the Language preferences in Browser, for
testing.)

The required string can be retrived in a JSP or
Servlet using rb.getString("<property_name>");

- Nimish


__________________________________
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Internationalization Help

Posted by Yansheng Lin <ya...@silvacom.com>.
i18n is not specific to tomcat.  and i am sure you can find some useful links on
google.

I found this particular tutorial very useful:
http://java.sun.com/docs/books/tutorial/i18n/

If you have any specific problem, for example, Apache serves up different
encodings correctly, while Tomcat has trouble with the same files, then post
your message here to see if anyone can help.

-Yan

-----Original Message-----
From: Santosh Joshi [mailto:santosh.joshi@apsolve.com] 
Sent: Thursday, February 26, 2004 6:25 AM
To: Tomcat Users List
Subject: Internationalization Help


All,

I am sure Tomcat can be internationalized to accept internationalized
character encoding, but the trouble is I do not know HOW?

Could someone point me to a quick HOW-TO guide?

BTW I am planning to use 4.1.30 (or later version) for this purpose. 

Any help very much appreciated.

Regards,

Santosh

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org