GenericValues implement LocalizedMap, simply using value.get("description", 
locale) should return the localized description.

Regards
Scott

On 18/06/2010, at 4:30 AM, Adam Heath wrote:

> Matthieu Bollot wrote:
>> Hi,
>> Is there a way to use entitylabels in a groovy ?
>> I've got a genericValue that contains a result, for example a workEffort
>> with workEffortTypeId:ROUTING that I can get with
>> myRow['workEffortTypeId']
> 
> myRow.workEffortTypeId is better.
> 
>> And I want to get the string of WorkEffortType.description.ROUTING from
>> workEffortEntityLabels which will be 'routing' in english, 'routage' in
>> french and so on.
> 
> I'm thinking about something groovy-ish; brainstorming...
> 
> In GenericEntity.java:
> 
> public Map<String, String> getLabels(Locale locale) {
> }
> 
> In groovy, or any other type of language:
> 
> myRow.getLabels('fr').workEffortTypeId
> 
> --
> 
> Of course, none of this is actually implemented yet.  And, for speed,
> the returned map should do a lazy lookup.  Ie, the returned map should
> not attempt to find all the translated values when the getLabels()
> method is called.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to