dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #38665
Re: [Bug 1471276] [NEW] available selection of data elements and indicators in wrong language in version 2.19
Hi again,
taking a deeper look into this issue, we had checked that Pivot Table
and Data Visualizer don't use the translation support of the API. For
pivot tables, we have tried modifying the API calls in this way (I
take DataElements as example):
from:
path = '/dataElements.json?fields=id,' + ns.core.init.namePropertyUrl
+ '&filter=dataElementGroups.id:eq:' + uid + (filter ?
'&filter=name:like:' + filter : '');
to:
path = '/dataElements.json?fields=id,' + 'displayName|rename(' +
ns.core.init.namePropertyUrl + ')&translate=true' +
'&filter=dataElementGroups.id:eq:' + uid + (filter ?
'&filter=name:like:' + filter : '');
and it works.
How can we move forward on this?
On 14 July 2015 at 16:22, Victor Garcia <vgarciabnz@xxxxxxxxx> wrote:
> Hi all,
>
> is there any news on this issue?
>
> Víctor
>
> On 3 July 2015 at 17:11, Rishi <rsukul@xxxxxxxxxxxxxxxxx> wrote:
>> Public bug reported:
>>
>> Dear all,
>>
>> Related to thread: https://lists.launchpad.net/dhis2-users/msg07563.html
>>
>> When making a new pivot table or graph using the data visualizer the
>> dataelements and indicators that are available for selection (in the
>> left side) are displayed not in the language of the profile. So if in
>> the profile settings, display and database language is set to french it
>> is expected that those indicators and elements are in that language as
>> well (of course when for each element and indicator the translations
>> have been added).
>>
>> Looking into the access log in Tomcat we saw the following call
>> server:portNumber/dhis/api/dataElements.json?fields=id,name&filter=domainType:eq:AGGREGATE&_dc=1435848215196&page=1&pageSize=50
>>
>> copying that into a browser results in the elements returned in the reference name which is in our case English.
>> Name is always the reference value and not the translation but changing that to displayName and adding translate=true to the call the fields are returned in the language of the user profile which is french. Perhaps this is a possible solution? To adjust the api call in the app.js to use "translate=true" and to change name to displayName? See an example below, we tested the call on itself and the data elements are returned in the language of the profile that is logged in ( french) with this call.
>>
>> server:portNumber/dhis/api/dataElements.json?translate=true&fields=id,displayName&filter=domainType:eq:AGGREGATE&_dc=1435848215196&page=1&pageSize=50
>>
>> What do you think?
>>
>> ** Affects: dhis2
>> Importance: Undecided
>> Status: New
>>
>>
>> ** Tags: 2.19 translate
>>
>> --
>> You received this bug notification because you are a member of DHIS 2
>> developers, which is subscribed to DHIS.
>> https://bugs.launchpad.net/bugs/1471276
>>
>> Title:
>> available selection of data elements and indicators in wrong language
>> in version 2.19
>>
>> Status in DHIS 2:
>> New
>>
>> Bug description:
>> Dear all,
>>
>> Related to thread:
>> https://lists.launchpad.net/dhis2-users/msg07563.html
>>
>> When making a new pivot table or graph using the data visualizer the
>> dataelements and indicators that are available for selection (in the
>> left side) are displayed not in the language of the profile. So if in
>> the profile settings, display and database language is set to french
>> it is expected that those indicators and elements are in that language
>> as well (of course when for each element and indicator the
>> translations have been added).
>>
>> Looking into the access log in Tomcat we saw the following call
>> server:portNumber/dhis/api/dataElements.json?fields=id,name&filter=domainType:eq:AGGREGATE&_dc=1435848215196&page=1&pageSize=50
>>
>> copying that into a browser results in the elements returned in the reference name which is in our case English.
>> Name is always the reference value and not the translation but changing that to displayName and adding translate=true to the call the fields are returned in the language of the user profile which is french. Perhaps this is a possible solution? To adjust the api call in the app.js to use "translate=true" and to change name to displayName? See an example below, we tested the call on itself and the data elements are returned in the language of the profile that is logged in ( french) with this call.
>>
>> server:portNumber/dhis/api/dataElements.json?translate=true&fields=id,displayName&filter=domainType:eq:AGGREGATE&_dc=1435848215196&page=1&pageSize=50
>>
>> What do you think?
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/dhis2/+bug/1471276/+subscriptions
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help : https://help.launchpad.net/ListHelp
References