struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian McSweeney" <>
Subject I8ln question
Date Tue, 24 Jun 2003 11:55:56 GMT
Hi folks,
In my application I have multiple category entries stored in a database
table named "categories".
For each entry, I have a name and a description field.
I want to internationalize the application with struts and have
identified two possible approaches.
1)       Set up a resource bundle which contains keys which are the same
as the database entries 
for name and description and use the <bean:message key. > tag to display
the correct name.
For example, say I have two category entries:
Name: fish 
            Description: fishdesc
            Name: dogs
            Description: dogsdesc
            Now in my resource bundle I can put:
            fishdesc=this category is for fishes
            dogsdesc=this category is for dogs
            And so, in my jsp I could hopefully use the <bean:message
key=<value of database field> />
            to display the correct thing. Adding a new language should
be simple here.
2)       I could also do this completely in the database, by creating a
language mapping table
For example
 -------------------                            -------------------
|   Category  |                             | CategoryI8ln |
            --------------------    1__________*    --------------------
            | PK             |                            | Name
            -------------------                             |
Description   |
                                                            | Language
            I would really like anyone's experience with trying to
internationalize data that is stored in 
            the database that won't change that often using struts. Do
you think option 1 or 2 is better,
            or do you have a different solution? 
            The advantages of solution 1 over solution 2 as I see them
            Simple database structure
            No need to have the database set up for UTF-8
            The disadvantages of solution 1 over solution 2 as I see
them are:
            Replication of the information in the database
            Can't add a new category on the fly
Any comments, suggestions would be much appreciated.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message