Hi Lars,
There is a Translate button beside the Organisation Unit name. I try entering the Org Unit name by English. But I couldn’t know how to display this English name although I choose English language in Setting. Could you please tell me what is this Translate button used for? And which case will the English name be displayed?
I’m afraid this is a known bug. Most of the code is in dhis-i18n-db, please have a look if you want to. Otherwise Bharath or I will fix it later.
Lars
···
2009/10/19 Thuy Nguyen thuy.hispvietnam@gmail.com
Hi Lars,
There is a Translate button beside the Organisation Unit name. I try entering the Org Unit name by English. But I couldn’t know how to display this English name although I choose English language in Setting. Could you please tell me what is this Translate button used for? And which case will the English name be displayed?–
Yes, Hieu is doing this.
···
2009/10/19 Lars Helge Øverland larshelge@gmail.com
2009/10/19 Thuy Nguyen thuy.hispvietnam@gmail.com
Hi Lars,
There is a Translate button beside the Organisation Unit name. I try entering the Org Unit name by English. But I couldn’t know how to display this English name although I choose English language in Setting. Could you please tell me what is this Translate button used for? And which case will the English name be displayed?–
I’m afraid this is a known bug. Most of the code is in dhis-i18n-db, please have a look if you want to. Otherwise Bharath or I will fix it later.
Lars
–
Thuy
HISP Vietnam
+84902079126
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 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 !
···
2009/10/19 Thuy Nguyen thuy.hispvietnam@gmail.com
Yes, Hieu is doing this.
2009/10/19 Lars Helge Øverland larshelge@gmail.com
2009/10/19 Thuy Nguyen thuy.hispvietnam@gmail.com
Hi Lars,
There is a Translate button beside the Organisation Unit name. I try entering the Org Unit name by English. But I couldn’t know how to display this English name although I choose English language in Setting. Could you please tell me what is this Translate button used for? And which case will the English name be displayed?–
I’m afraid this is a known bug. Most of the code is in dhis-i18n-db, please have a look if you want to. Otherwise Bharath or I will fix it later.
Lars
–
Thuy
HISP Vietnam
+84902079126
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp
–
Hieu.HISPVietnam
Good Health !
Dear Lars,
I have fixed the problem that I presented in the previous mail. So, can I commit the modified source to trunk ???
Btw, about the bug which was presented by Thuy is in progress … I will try to finish this as soon as possible.
Thanks !
···
2009/10/20 Hieu Dang Duy hieu.hispvietnam@gmail.com
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 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 !
–
Hieu.HISPVietnam
Good Health !
–
Hieu.HISPVietnam
Good Health !
Hi Hieu - I will let Lars decide on committing, but would just like to thank you very much for fixing this problem - it is really important for many countries, for example India, which has 16 official languages (!). And the multilanguage capability of DHIS 2 is to my mind a major selling point - also when using DHIS 2 as a repository of metadata internationally.
So many thanks!
Knut
···
2009/10/21 Hieu Dang Duy hieu.hispvietnam@gmail.com
Dear Lars,
I have fixed the problem that I presented in the previous mail. So, can I commit the modified source to trunk ???
Btw, about the bug which was presented by Thuy is in progress … I will try to finish this as soon as possible.
Thanks !
2009/10/20 Hieu Dang Duy hieu.hispvietnam@gmail.com
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 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 !
–
Hieu.HISPVietnam
Good Health !
–
Hieu.HISPVietnam
Good Health !
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp
–
Cheers,
Knut Staring
Dear Knut,
I really am happy when you said about that. The bug in Translation function had been fixed absolutely. But as I said before I am stilling in progress to finish the known bug that Thuy and Lars presented.
For example, when you clicked on list of “Interface Language” to choose your location’s language. And then clicking on the sub-menu as Organisation Units onto Maintenance menu. And the result which we can see is that the Orgunit’s name belongs to the location’s language.
Btw, I am lucky during on testing for Organization Units. The unlucky is that I am not good at I18n object.
So, It’s still take a long time to fix…or someone can help me solve this issue ?
Again, thank you very much !
···
2009/10/21 Knut Staring knutst@gmail.com
Hi Hieu - I will let Lars decide on committing, but would just like to thank you very much for fixing this problem - it is really important for many countries, for example India, which has 16 official languages (!). And the multilanguage capability of DHIS 2 is to my mind a major selling point - also when using DHIS 2 as a repository of metadata internationally.
So many thanks!
Knut
–
Cheers,
Knut Staring
–
Hieu.HISPVietnam
Good Health !
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
···
2009/10/20 Hieu Dang Duy hieu.hispvietnam@gmail.com
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 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 !
Dear Lars and everyone,
Thank you for replying to me on this issue,
But seemly that, my previous mail maybe not clearly to describe the problem which I want to express to you. So, this is a simple example for this one:
GENERAL: **
This is the method will be used to convert the input Collection, where contains one or many TRANSLATION object****(s)**
***private Map<String, String> convertTranslations( Collection
translations )
{
Map<String, String> translationMap = new Hashtable<String, String>();
for ( Translation translation : translations )
{
if ( translation.getProperty() != null && translation.getValue() != null )
{
translationMap.put( translation.getProperty(), translation.getValue() );
}
}
return translationMap;
}***
CASE NUMBER 1:
As we knew, the method which is being used in I18nAction.java file is:
getTranslations( String className, int objectID, Locale locale );
You can see that this method receives three of arguments. And specially, we should attend to the second argument. It will present for one corresponding Translation object.
Or we can understand that the method above which would return only and only one object that was contained in Map.
It’s very easyto check this by the simple query in you DB:
···
__SELECT * FROM TRANSLATION
WHERE objectClass = ‘className’
AND objectId = objectID
AND locale = ‘locale’;__---------------------------------------------------------
Note: We could get the result with one or many row(s) from this statement query. BUT it’s only ONE TRANSLATION object that contains one or many properties (they are: name, shortname, comment, description, etc…).
CASE NUMBER 2:
How about the case that we will use the method as following form:
getTranslations( String className, Locale locale );
The method above will return a Collection of None of Duplicated TRANSLATION objects, also we can check this by the simple query:
__SELECT * FROM TRANSLATION
WHERE objectClass = ‘className’
AND locale = ‘locale’__ ;
And the problem will occur in this case if we try to use convertTranslations(Collection) to convert the specified Collection to Map<String, String>
More details by checking the example below:
For example, I have got a Collection object which contains 3 Elements (3 Translation objects):
Translation A
name: A
shortname: A
Translation B
name: B
shortname: B
comment: “This is Translation B”
Translation: C
name: C
And then, using the convertTranslation() method for this Collection. What will be happened in this case?
Can you guys imagine the result that we will get ???
In my opinion, the result is that:
Map {
[ name = TranslationC.name,
shortname = TranslationB.shortname,
comment = TranslationB.comment ]
}
What are you thinking about the result as presented. Anything’s wrong here ?
Thanks for all and expecting your idea/explanation.
P.S 1: I copied as quickly paste the description of the put() method of Map class. Please take around:
===========================================================================
String java.util.Map.put(String key, String value)
put
V **put**(K key,
V value)
Associates the specified value with the specified key in this map (optional operation). If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k)
would return true.)
Parameters:
key
- key with which the specified value is to be associated
value
- value to be associated with the specified key ===========================================================================
P.S 2: Sorry for a mail is too long !
2009/10/21 Lars Helge Øverland larshelge@gmail.com
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
–
Hieu.HISPVietnam
Good Health !
Hi all,
Enclosed the files that express the bug which I presented:
See at sequence: pic_1 → pic_2 → pic_3 → pic_4
Pic_1: Click on Translation for Vietnam orgunit. Then look at Pic_2 (the console’s messages)
Pic_2: Only one element in Map, which was returned.
Pic_3: First, Vietnam’s properties which “name”, “shortname”, “comment” are empty.
Then, assigned the name’s value is “Vietnam” and the comment’s value is “Republic Society of Vietnam”. The shortname’s value was left with empty value. And then click Save.
Again, clicked on Translation for Vietnam then see Pic_4. It’s still only one element in Map, which was returned. We could recognize that Vietnam’s shortname had been assigned with “BacLieu”. But “BacLieu” is the shortname of Bạc Liêu province in Vietnam.
Thanks !
···
–
Hieu.HISPVietnam
Good Health !
Dear Lars and everyone,
I knew that you are really busy in this time. But so curiously, did you read my responding two mails on the issue of Translation. If you really don’t mind I will commit my fixed source code onto some of api, service, aslo vm files of Translation module.
Sorry you first, because of if have any change that influencing on the other modules. At that time, can I have you revert to the latest reversion. But I think it will be okay. ^_~
Btw, I’d like to commit an other modification to view the effect from applying Translation function on “Organisation unit Management” module. If disliked you can revert all of them also.
Give me you all idea/opinion/suggestion on this.
Thank you guys so much !
···
–
Hieu.HISPVietnam
Good Health !