Adam Hardy wrote:

On 10/17/2003 09:56 PM Ruth, Brice wrote:

Greetings, all.

I'm looking for some guidance on how best to go about a requirement I have from our marketing as far as URL naming goes. We're developing an international (localized) site and we have a requirement that the URLs look something like this:

domain/us/<whatever>
domain/fr/<whatever>
domain/de/<whatever>
etc.

Now, I have a pretty decent grasp on how I'm going to use the localization features of Tiles and Struts to localize the site, but how best do I go about fulfilling the requirement outlined above?


Hi Brice,
first thing you've got to decide is whether you are going to select that locale based on their browser settings, or whether you are going to show them the default locale first and let them click on their chosen flag.


You also don't say if you have all your localized text in resources files, or whether you also have large amounts of text in static files, one language per file.

I tried to remember whether you can use wild cards in your action mapping paths in struts-config.xml, but I can't get my brain in gear right now.

So if you can, map your actions like so "/*/*/whatever.do" but if not, then you might have to repeat the whole mapping for each locale.

Fortunately the servlet mapping to the struts action servlet definitely takes wildcard characters, so *.do will match all your locale URLs.

Have fun,
Adam

On the first point, our site will have a global landing page that will present the user with flags to choose their locale. So with that point of entry, I'm set - I can have the flags link to an action that sets the selected locale in the user's session and sets a cookie, possibly, so that they don't have to go through that again when they return.


As for how the site is localized, some of that I'm still determining, but for the most part, I'm going to take advantage of resource files as well as localized tile definitions, to the greatest extent possible. There will be areas of the site that aren't shared between countries, however, that will likely be served from static files, or dynamic files that are only localized to a particular language.

I think I kind of understand the solution proposed with the wildcards .. but one of the things I'm fuzzy on is how to handle the situation of deep-links - if someone links to http://domain/us/index.jsp - then somehow, the locale needs to be initted to 'en_US', right? - without relying on there being a cookie present from a previous visit, of course. If I split out the mappings for each locale, can I set the default locale for that mapping in struts-config.xml or is this something that's done in web.xml/server.xml?

Thanks for the response on this - the best way of going about this hasn't quite crystallized yet, but I think I'm getting close.

Thanks again.
Brice

--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to