Fw: Localization

Hi devs,

I was wondering why I didn’t receive my message sent to mailing list. Mostly due to change of my email address for dhis2 mailing lists. Please see forwarded message FYI. My changes are committed now.



---------- Forwarded message ----------
From: Murodullo Latifov murodlatifov@yahoo.com

Date: Sat, Jan 29, 2011 at 12:29 AM
Subject: Fw: Localization
To: mlatifov@gmail.com

----- Forwarded Message ----

From: Murodullo Latifov murodlatifov@yahoo.com
To: DHIS 2 developers dhis2-devs@lists.launchpad.net

Sent: Thu, January 27, 2011 4:06:07 PM
Subject: Localization


It seems on each locale change there is massive read/write performed and is costly. This happens when persisted property of object gets changed, hibernate will apply such changes somehow. Looking at localization technique I made some changes to avoid this. I have created 3 extra properties: nameLocalized, shortNameLocalized and descriptionLocalized in IdentifiableObject, which is inherited by all metadata objects. So instead of reading localized strings into “name” field I am reading it to “nameLocalized” using invocation of setNameLocalized(), which is not mapped by hibernate. This will not change persisted property and also does not mess up, when two concurrent calls are made with two different locales. Sometimes I see DE names in mix of tajik, russian and english on interface and table too.

If the idea is good we need to work towards this, as it affects all interfaces, and particularly reporting tables, they should use new properties instead of name and shortname. Also should speed up as writes are omitted for localization.

Due to limitation in time to discuss all issues with other devs I created my branch at launchpad.net~murodlatifov
Will commit these changes tomorrow.
Also I made editing of Dataelements in ajax way, because after edit DE list is shown from the first page instead of going to page (place) user made edit. Same should be done for translation.

Also OrgUnit localization put in place.