You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by kuni katsuya <ku...@thinoffice.com> on 2001/06/15 09:10:48 UTC

i18n & static html pages

anyone have any ingenius ideas on how to implement i18n with both static
(html) and dynamic (jsp) pages that are not necessarily in the same context?

in my application, i am allowing the user to switch locales on-the-fly.
(don't ask!!) between jsp pages, this is taken care of simply by a
SetLocaleAction i've implemented which merely sets the locale in the user's
session. the rest is handled by struts. dumb easy.

now, if part of the "application" is static web pages outside of the jsp
context (ie. static pages are going to be served by apache as opposed to
tomcat, and so external to the jsp context) and i link to them from the jsp
and vice versa, how can i maintain the appropriate language view?

for argument's sake, let's say the static html is tidily divided into
locales by directory such as /en_CA, /fr_CA,...

desired behavior:
1. user accesses <some context>/foo.jsp in english [mode=english]
2. user switches to french (setLocale.do?language=fr&country=CA)
[mode=french]
3. foo.jsp redisplays itself in french. [mode=french]
4. a link on foo.jsp points to <some server>/fr_CA/moo.html. user clicks and
french moo.html displays. [mode=french]
5. on moo.html, there is a link to switch to a german version of moo.html.
user clicks it. and german moo.html displays. [mode=german]
6. on moo.html, there is a link back to foo.jsp. user clicks it and german
foo.jsp displays. [mode=german]

i can think of a few ways of doing this, but they're all brute force.

suggestions? best one wins a cookie. :)