You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Nacho <na...@siapi.es> on 2000/04/02 23:03:56 UTC

Internacionalization?

Digging into Tomcat code trying to figure out how this code works, i
have ended (logically) into StringManager and this lines of code:

    private StringManager(String packageName) {
		 String bundleName = packageName + ".LocalStrings";
		 bundle = ResourceBundle.getBundle(bundleName);
    }

There is no much internazionalization here :-).

Where is the global locale for Tomcat? , are there any provisions for
that? 


Saludos ,
Ignacio J. Ortega

Re: Internacionalization?

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Nacho wrote:

> Digging into Tomcat code trying to figure out how this code works, i
> have ended (logically) into StringManager and this lines of code:
>
>     private StringManager(String packageName) {
>                  String bundleName = packageName + ".LocalStrings";
>                  bundle = ResourceBundle.getBundle(bundleName);
>     }
>
> There is no much internazionalization here :-).
>
> Where is the global locale for Tomcat? , are there any provisions for
> that?
>

Tomcat uses the default locale under which it is started (that is, the
Locale returned by Locale.getDefault()).  In my case, this is a US
locale, but it depends on your local machine configuration and how your
JVM decides what to use for a default (for example, with the IBM 1.1.8
JVM on Linux you can set this with an environment variable).

However, if your default locale is Spanish, the
ResourceBundle.getBundle() method will load from a properties file named
"LocalStrings_es.properties" (if it exists), instead of the default
"LocalStrings.properties", and therefore pick up the translated
messages.  All that's needed is to create translated versions of the
LocalStrings.properties files for each of the Java packages.

>
> Saludos ,
> Ignacio J. Ortega
>

Craig McClanahan