History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LOOM-147
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Ignacio Coloma
Reporter: Ignacio Coloma
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Loom

Easier translation mechanism for JSP pages (warning: changes existing behavior)

Created: 05/Feb/09 11:01 AM   Updated: 05/Feb/09 11:41 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1


 Description  « Hide
After some discussion, it seems that the easiest way to achieve translations of simple strings in JSP pages is the following:

${messages['stringToTranslate']}

This can be implemented by making MessagesRepository implement the Map interface, but it requires renaming the messagesRepository request attribute from 'messagesRepository' to 'messages'.

So, the warning is: if you are using ${messagesRepository} in your JSP pages, you should rename it to ${messages}. Java code should be fine, as long as it's using RequestAttributeNames.MESSAGES_REPOSITORY which will be updated accordingly.

 All   Comments   Change History      Sort Order:
Ignacio Coloma - 05/Feb/09 11:28 AM
Instead of making MessagesRepository implement Map, which would expose the class internals and make it much harder to use, an ummodifiable adapter class will be used.

To get the reference to the real MessagesRepository, just invoke ${messages.messagesRepository}