← Back to team overview

dhis2-devs team mailing list archive

Re: Translate Organisation unit name

 

2009/10/20 Hieu Dang Duy <hieu.hispvietnam@xxxxxxxxx>

> Dear Lars,
>
> Can you have a quickly view at "*DefaultI18nService.java*" file into ***
> dhis-i18n-db* package ?
>
> I wanna ask you about the method is
> "Map<String, String> *convertTranslations*( Collection<Translation>
> translations )"
>
> I think that this method which is ONLY RIGHT if and only if the specified
> Collection contains only one and only one result that returned from *
> getTranslations()* or one Translation object with an another
> understanding. Although, this method returns a collection of Translation
> objects.
>
> That means is convertTranslations() method will return only ONE unique KEY
> for ONE unique VALUE which is contained into Map.
>
> So, what will be happened if we have got a Collection that contains so many
> Translation objects but the same properties (such as: name, shortname,
> description, etc...).
>
> I have an suggestion for that issue. We should make a combinative key
> between the object's ID and object's property. And the key will have a form
> as <Integer, String>.
>
> How about your opinion on this problem ?
> Is that a real problem as I think or maybe I'm wrong ?
>
> Thank you so much !
>
>
>
Hi Hieu

I see your point and understand what you mean. But after looking at the code
it seems this is not the cause of the problem. The convertTranslations
method is used for only one object at the time, meaning that duplicates will
never occur (since an object does not have properties with the same name).
Anyway thanks for looking into this :-)

cheers

Lars

Follow ups

References