For a long time, I never paid much attention to localization because my users all spoke
English. Alas, I now need the convenience of localization.
I remember that the earlier generation of seam-gen (the one built into the Hibernate
reverse engineering tool part of the JBoss IDE) embedded message bundle lookups for all of
its generated labels. But it would seem that this feature no longer exists, and I am
seeing a lot of hard-coded English.
For example, in seam-gen\view\edit.xhtml.ftl:
| <h:commandButton id="save"
| value="Save"
| action="${'#'}{${homeName}.persist}"
| disabled="${'#'}{!${homeName}.wired}"
| rendered="${'#'}{!${homeName}.managed}"/>
|
and in seam-gen\view\editproperty.xhtml.ftl:
| <ui:define name="label">${componentProperty.name}</ui:define>
|
For the first case, I could see seam-gen automatically declare some constants for common
labels like "Save", "Delete", "Cancel", etc. Let's say
they were called, "Seam.Edit.Save", then the template could embed a messages
lookup:value="#{messages['Seam.Edit.Save']}"
For the second case, it is a little more complicated because the template needs to have a
messages lookup and we need to augment the messages.properties file... The first part is
easy enough, but the messages.properties file looks like a constant artifact in seam-gen.
Adding a message bundle lookup for field labels would help in renaming the fields -- I
only need to tweak the message bundle instead of editing 3 xhtml files for each business
domain object.
But before I dig any further, it looks like someone has beat me to this issue and logged
an issue already:
http://jira.jboss.org/jira/browse/JBSEAM-1206
Any plans for getting this in the 1.3 beta?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051162#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...