I'm stuck with what is probably a fairly common problem. I have to present my 
users with a list of options (in the form of a combo box). The list comes from 
the database. The only problem is that the labels have to be locale dependent. 
I'm trying to find a nice design pattern that would work AND be clean. The list 
of option is fairly static. The user will not be able to edit it, it will be 
generated at deploy time.



Some ideas : have a table in the DB with the different translations, and pass 
the current locale to the service layer so it loads the right translation. That 
would not be too hard to implement, but might not be the best idea. I think 
i18n should be more a presentation level problem and not a service level. 
Beside, I'd like to have all translation in the application-resource.properties 
(easier to maintain).



Second option : store a key instead of a label in the DB, use that key to get 
the translation back from application-resource.properties. I think it is a 
cleaner approach, but ... In this case, I could translate the beans on the 
flight in the controller, or do the translation in the JSP (with 
<bean:message/>). Which is better ? There still is the problem of keeping the 
DB and the application-resource.properties in sync, but that is not a major 
concern to me (unless you have a better solution ...).



Do you have any other idea ? Any comment on my approach ?
--
--

Jabber : [EMAIL PROTECTED] (feel free to contact me)
_________________________________________________________
Reply to the post : http://galaxy.andromda.org/forum/viewtopic.php?p=2374#2374
Posting to http://forum.andromda.org/ is preferred over posting to the mailing 
list!


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, 
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Andromda-user mailing list
Andromda-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to