Re: Internationalisation and Database/EJB data
You need to design multiple language ability into your database schema. I would create a view to make the queries easier. David From: Jordan Thomas [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts-User [EMAIL PROTECTED] Subject: Internationalisation and Database/EJB data Date: Tue, 17 Dec 2002 20:50:18 +0100 Hi, What is the best way to make the data in my Database tables/EJB's internationalised? Is there a standard pattern for having seamlessly internationalised data in a database that I can use with struts? Essentially, based on the user's locale I want different data displayed and unfortunately, resource files won't suffice. thanks Jordan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Internationalisation and Database/EJB data
Your database schema will largely depend on the amount/type of data that you need to internationalize...are you internationalizing entire documents, paragraphs of text, just messages, all three? Do you need localized images too? Once you settle on a database schema, you can write a custom MessageResources implementation to fetch your messages. Your impl will be used by Struts for the bean:write tag and any other Struts classes/tags which fetch localized content. The MessageResources implementation factory is specified by an ActionServlet init parameter: init-param param-namefactory/param-name param-valuecom.mycompany.strutsstuff.myubercoolresourcesfactory/param-value /init-param You can easily extend the MessageResources if you wish, and write other custom tags to retrieve, say, XML-based localized documents, if need be. If you search the archive( http://www.mail-archive.com/struts-user%40jakarta.apache.org/ ), you should find plenty of posts on the topic, and I believe someone has written a standard DB-based implementation of MessageResources to replace the file-based one. hope this helps, Joe -Original Message- From: David Graham [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 12:02 PM To: [EMAIL PROTECTED] Subject: Re: Internationalisation and Database/EJB data You need to design multiple language ability into your database schema. I would create a view to make the queries easier. David From: Jordan Thomas [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts-User [EMAIL PROTECTED] Subject: Internationalisation and Database/EJB data Date: Tue, 17 Dec 2002 20:50:18 +0100 Hi, What is the best way to make the data in my Database tables/EJB's internationalised? Is there a standard pattern for having seamlessly internationalised data in a database that I can use with struts? Essentially, based on the user's locale I want different data displayed and unfortunately, resource files won't suffice. thanks Jordan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- 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]
RE: Internationalisation and Database/EJB data
I've done something like this. i.e. i have extended the PropertyMessageResources etc. and add extra stuff to fetch data in the relevant locale depending on the browsers locale. It works a really well for me. From: Joe Barefoot [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: Internationalisation and Database/EJB data Date: Tue, 17 Dec 2002 13:16:56 -0800 Your database schema will largely depend on the amount/type of data that you need to internationalize...are you internationalizing entire documents, paragraphs of text, just messages, all three? Do you need localized images too? Once you settle on a database schema, you can write a custom MessageResources implementation to fetch your messages. Your impl will be used by Struts for the bean:write tag and any other Struts classes/tags which fetch localized content. The MessageResources implementation factory is specified by an ActionServlet init parameter: init-param param-namefactory/param-name param-valuecom.mycompany.strutsstuff.myubercoolresourcesfactory/param-value /init-param You can easily extend the MessageResources if you wish, and write other custom tags to retrieve, say, XML-based localized documents, if need be. If you search the archive( http://www.mail-archive.com/struts-user%40jakarta.apache.org/ ), you should find plenty of posts on the topic, and I believe someone has written a standard DB-based implementation of MessageResources to replace the file-based one. hope this helps, Joe -Original Message- From: David Graham [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 12:02 PM To: [EMAIL PROTECTED] Subject: Re: Internationalisation and Database/EJB data You need to design multiple language ability into your database schema. I would create a view to make the queries easier. David From: Jordan Thomas [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts-User [EMAIL PROTECTED] Subject: Internationalisation and Database/EJB data Date: Tue, 17 Dec 2002 20:50:18 +0100 Hi, What is the best way to make the data in my Database tables/EJB's internationalised? Is there a standard pattern for having seamlessly internationalised data in a database that I can use with struts? Essentially, based on the user's locale I want different data displayed and unfortunately, resource files won't suffice. thanks Jordan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- 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] _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Internationalisation and Database/EJB data
Thanks for that David. OK, one step further, what about with EJB? The obvious way is to use a compound key but this makes JBoss spew when I try to use it how I need. Any more suggestions? cheers Jordan -Original Message- From: David Graham [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 17 December 2002 9:02 PM To: [EMAIL PROTECTED] Subject: Re: Internationalisation and Database/EJB data You need to design multiple language ability into your database schema. I would create a view to make the queries easier. David From: Jordan Thomas [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts-User [EMAIL PROTECTED] Subject: Internationalisation and Database/EJB data Date: Tue, 17 Dec 2002 20:50:18 +0100 Hi, What is the best way to make the data in my Database tables/EJB's internationalised? Is there a standard pattern for having seamlessly internationalised data in a database that I can use with struts? Essentially, based on the user's locale I want different data displayed and unfortunately, resource files won't suffice. thanks Jordan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- 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]