Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.0.3
-
Fix Version/s: None
-
Component/s: TagLib
-
Labels:None
Description
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
What about plan names like "Hi, I'm a plan name". What must be the properties key in message.properties? This is why Grails use id instead of optionValue.