tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arieh Markel <Arieh.Mar...@Central.Sun.COM>
Subject Re: Localization and DefaultServlet
Date Mon, 19 Jun 2000 18:31:49 GMT

> From: "Juan Jose Pablos" <>
> To: <>, "Arieh Markel" 
> Subject: Re: Localization and DefaultServlet
> Hi Arieh,
> I think that you should not use the directory as the way to find the
> resource, if you use LocalStrings_<Locale>.properties in the servlet, using
> a diferent mapping does not seems right. I mean you know if you use
> ResourceBundle.getBundle (resource, Locale), it tires to get it from a
> properties file like LocalStrings_<Locale>.properties, so same mapping to
> get resources make them easier to remember and understant.

Juan Jose,

thanks for the input.

With regards to doing something similar to the ResourceBundle, I did not
intend to be understood as doing literally the same.

The problem with appending the <locale> is such that in Unix systems, due
to not having a 'filetype' component as an integral part of a pathname,
it would force to make too many assumptions on where the insertion of the
<locale> should happen.

I don't want to do it in such a manner.

> Another thing, For deep path /a/b/c/d, how are you going to search the right
> localized
> resource  /a/b/c/d/en or /en/a/b/c/d, its seems more expensive than the
> other solution isn't it?

So far, I am thinking of changing the locale at the root of the document
hierarchy (/en/a/b/c/d) - assuming docRoot is '/' in this example, which will 
make the search/identification of an existing document simpler, as the docBase 
needs to be prefaced with the locale.

If in a different context, for example where the docRoot would be
/services, then /services/dir1/dir2/file.html would be searched first
as /services/<locale>/dir1/dir2/file.html.

> if you add the locale information on the name of file
> name_<locale>.extension  that information is keep if the file is move to
> another directory, if you move <locale>/myfile to /, how do you know the
> localize information now?

Like I said before, it introduces some problems as far as the naming of the
resource and assuming that there is indeed a filetype. Imagine for
example that a pathname has no <implicit> filetype, i.e. /a/b/my_image,
in such a case the <locale> would be appended and not inserted prior to
the (last - in this case inexistent) period.

> It is just a few thoughts from a Junior in a chat of experts...
> Juan


 Arieh Markel		                Sun Microsystems Inc.
 Network Storage                        500 Eldorado Blvd. MS UBRM11-194
 e-mail: arieh.markel@sun.COM           Broomfield, CO 80021
 Let's go Panthers !!!!                 Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)

View raw message