> -----Original Message-----
> From: Joe Germuska [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 31, 2002 8:04 AM
> To: Struts Users Mailing List
> Subject: Re: Internationalizing large amounts of text
> 
> 
> At 11:24 AM -0300 2002/07/31, Steven Banks wrote:
> >I have been asked to convert some static html pages to jsp pages 
> >using Struts.  These pages include several very large paragraphs, 
> >like important notices and privacy statements.
> >
> >Should all this text be put into the applicationResource.properties 
> >file?  Is it acceptable to have the appropriately internationalized 
> >static html text included in the page using an equals tag to 
> >determine which language version to include.
> 
> You could do it that way, but I think it would become a management 
> headache.  While I've used properties files for a few multi-line 
> messages, the fact that they are line-oriented means you have to be 
> careful to maintain line-continuation characters (\) at the end of 
> each line in your message.  If you want them to be editable by 
> non-programmers, those are the kinds of details they often overlook.

One way of avoiding the headache is to put the longer chunks of text into
their own properties file, and/or use a tool like RBManager to edit them.

http://www.alphaworks.ibm.com/tech/rbmanager

> 
> If you're using Struts 1.1 you might consider implementing your own 
> Message Resources which doesn't have to use a properties file to get 
> its data.  Your version, for example, might look up a text file (or 
> HTML fragment) by constructing a path based on the language and the 
> message key.

You can do this in Struts 1.0.x as well. You configure it by specifying the
'factory' init-param in your web.xml file. See:

http://jakarta.apache.org/struts/doc-1.0.2/api/org/apache/struts/action/Acti
onServlet.html

In Struts 1.1, it's configured in struts-config.xml instead.

--
Martin Cooper


> 
> If you're not using Struts 1.1, you might consider writing your own 
> custom tag to do something similar.  Writing custom tags is fairly 
> easy, although I found Sun's documentation a little unclear -- 
> fortunately, you have several working examples in the Struts source 
> code to go from.
> 
> Hope that helps,
>       Joe
> 
> -- 
> --
> * Joe Germuska    { [EMAIL PROTECTED] }
> "It's pitiful, sometimes, if they've got it bad. Their eyes get 
> glazed, they go white, their hands tremble.... As I watch them I 
> often feel that a dope peddler is a gentleman compared with the man 
> who sells records."
>       --Sam Goody, 1956
> tune in posse radio: <http://www.live365.com/stations/289268>
> 
> --
> To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



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

Reply via email to