You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chris Pratt <th...@gmail.com> on 2006/10/19 19:19:59 UTC

Internationalizing an entire Tile

I have the I18N support for externalizing strings working great in
Struts/Tiles, but we have several Tiles that are all text and it doesn't
really make sense to copy all that text into the resource bundle and have an
empty Tile that just retrieves the text.  I was hoping there was a way to do
something like define a tile.jsp and tile_fr.jsp and have it pick the right
one automatically, but that doesn't seem to be working.  Is there a simple
way to accomplish this?
  (*Chris*)

Re: Internationalizing an entire Tile

Posted by Chris Pratt <th...@gmail.com>.
That seems to work pretty well.  And it's nice since you only have to
include the definitions that override the standard definitions.  Thanks for
the pointer.
  (*Chris*)

On 10/19/06, Laurie Harper <la...@holoweb.net> wrote:
>
> Chris Pratt wrote:
> > I have the I18N support for externalizing strings working great in
> > Struts/Tiles, but we have several Tiles that are all text and it doesn't
> > really make sense to copy all that text into the resource bundle and
> > have an
> > empty Tile that just retrieves the text.  I was hoping there was a way
> > to do
> > something like define a tile.jsp and tile_fr.jsp and have it pick the
> right
> > one automatically, but that doesn't seem to be working.  Is there a
> simple
> > way to accomplish this?
> >  (*Chris*)
>
> I believe Tiles can do this for you, at the expense of a little extra
> configuration. The only documentation I can find at the moment is from
> the Struts Tile main project page [1], where it says
>
> #  Internationalization (i18n)
>
>      * It is possible to load different tiles according to Locale.
>      * A mechanism similar to Java properties files is used for
> definitions files: you can have one definition file per Locale. The
> appropriate definition is loaded according to the current Locale.
>
> So I suspect you need localized tiles defs to point to your localized
> JSPs. Sorry I can't point you at more specific documentation of how this
> aspect of Tiles works :-(
>
> L.
>
> [1] http://struts.apache.org/1.3.5/struts-tiles/index.html
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Internationalizing an entire Tile

Posted by Laurie Harper <la...@holoweb.net>.
Chris Pratt wrote:
> I have the I18N support for externalizing strings working great in
> Struts/Tiles, but we have several Tiles that are all text and it doesn't
> really make sense to copy all that text into the resource bundle and 
> have an
> empty Tile that just retrieves the text.  I was hoping there was a way 
> to do
> something like define a tile.jsp and tile_fr.jsp and have it pick the right
> one automatically, but that doesn't seem to be working.  Is there a simple
> way to accomplish this?
>  (*Chris*)

I believe Tiles can do this for you, at the expense of a little extra 
configuration. The only documentation I can find at the moment is from 
the Struts Tile main project page [1], where it says

#  Internationalization (i18n)

     * It is possible to load different tiles according to Locale.
     * A mechanism similar to Java properties files is used for 
definitions files: you can have one definition file per Locale. The 
appropriate definition is loaded according to the current Locale.

So I suspect you need localized tiles defs to point to your localized 
JSPs. Sorry I can't point you at more specific documentation of how this 
aspect of Tiles works :-(

L.

[1] http://struts.apache.org/1.3.5/struts-tiles/index.html


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org