There are times when the locale-specific content is sufficiently voluminous and complicated that using a resource bundle is impractical. A good example is "help" text. A help page has (potentially) layout and graphics - as well as the copy itself - that all needs to be tuned to a specific locale.
One could write an action that'd find the right .jsp file. This is something I'll be needing to do some time soon, but I'm not 100% sure how to approach it yet. One thing I've thought of is to (somehow; may or may not be possible) have the top of the .jsp tree in the CLASSPATH for the web app code. Then the "help" action (or any other locale-finding action) can poke around using "getResource" to see what .jsp files are actually available. When it finds one, it can return an appropriate forward resolution. On Fri, Aug 7, 2009 at 4:49 PM, Nathan Maves<[email protected]> wrote: > why not put the content on those files into a resource bundle and > handle it like all other internationalized text. > > nathan > > On Fri, Aug 7, 2009 at 1:52 PM, Daniil Sosonkin<[email protected]> wrote: >> Hi all, >> >> This isn't really a Stripes question, although if Stripes already provides a >> support for that it would be even better, but here it goes. Is there a way >> to conditionally include a .jsp file based on user's locale. For example, I >> would have files - agreement.jsp, agreement.ru.jsp, agreement.zh_CN.jsp. And >> then I would do something like: <jsp:include template="agreement" >> localeBased="yes" /> >> >> That tag would pick the most appropriate template based on the locale and >> availability of it and include it? >> >> Any help is appreciated! >> >> Thank you, >> Daniil >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day >> trial. Simplify your report design, integration and deployment - and focus >> on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> Stripes-users mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/stripes-users >> >> > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Stripes-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/stripes-users > -- Turtle, turtle, on the ground, Pink and shiny, turn around. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users
