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

Key: GRAILS-3091
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Graeme Rocher
Reporter: Pierre Delagrave
Votes: 0
Watchers: 1
Operations

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

<g:select> tag to allow using optionValue with valueMessagePrefix for resolving i18n messages

Created: 10/Jun/08 01:10 PM   Updated: 10/Jun/08 01:10 PM
Component/s: TagLib
Affects Version/s: 1.0.3
Fix Version/s: 1.0.4

Time Tracking:
Not Specified


 Description  « Hide
The current implementation of <g:select> tag allow the generation of i18n message in the body of the <option> tags from the concatenation of valueMessagePrefix and optionKey. This makes the programmer having to use message.properties i18n string codes like: book.1, book.2 because the <g:select> optionKey attribute is often an ID.

The idea here is to make <g:select> use the optionValue with the valueMessagePrefix to produce i18n string code like: plan.all, plan.nothing, plan.other

Example of when its needed:
class Plan { String name }

where plan.name is a string to be resolved.
The Plans are statically stored in the database and won't be modified dynamically. We want the name of the plans to be translated in many languages and want to use the grails i18n messages feature.
That's why it is needed to resolve a given prefix like 'plan', to every plan.name in a collection in the <g:select> tag.

Thanks

Pierre Delagrave



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.