On Mon, 19 Mar 2001, Kyle Robinson wrote:

> I understand Struts has support for makeing web apps available in different
> languages.  Does this include images?  If I have images with text on them in
> English can I make images with text in French as well?  Do I name the image
> files differently or do I have to include the paths to the images in the
> property files?  Has anyone done this?  What's the best approach?
> 

There was a recent addition to the <html:image> and <html:img> tags to
support internationalized images elegantly.

Previously, you had to use the "src" attribute to specify the URI of your
image.  If you needed different images for each language, you had to use a
scriptlet expression of some sort to calculate them.

Now, you can specify a message key (to be looked up in your application
resources) instead:

        <html:image srcKey="message.key"/>

where "message.key" identifies the path to this image from your
application resources.

If you want to use context-relative paths everywhere, use:

        <html:image pageKey="message.key"/>

instead.

> Kyle Robinson
> Systems Consultant
> Pangaea Systems Inc.
> (250) 360-0111
> 
> 

Craig


Reply via email to