← Back to team overview

dhis2-devs team mailing list archive

Re: updating display names independently from name

 

Hi Blake,

the displayName is not a persisted property of the data model. This
property gets populated based on the translations available for the object
for the currently selected locale.

Example from the demo:

https://play.dhis2.org/demo/api/dataElements/FTRrcoaog83?fields=id,name,code,translations

This dataelement has 8 translations available, including one for the french
locale for the name property.

When you have set the db locale for your user to french, the system will
render that french translation ("Accute French") as the *displayName*
property value.

The idea is that all clients should use the displayName (or display***)
property for their UIs. This is a transient field which is populated by
DHIS 2.

To store translations in DHIS 2 for a specific locale, you can POST the
translation part of the object itself in the same format as it is rendered
(see URL example above). Docs here
<https://docs.dhis2.org/master/en/developer/html/webapi_browsing_the_web_api.html#webapi_translation>
.

This can of course also be done through the maintenance app UI.


best regards,

Lars









On Thu, Jan 26, 2017 at 11:20 AM, Blake Hansen <bhansen@xxxxxxxxxxxxxx>
wrote:

> Dear Devs,
>
> I have been trying to change the display names (displayName,
> displayFormName etc…) of some data elements so that they are different to
> the name, displayName etc… I have a use case where data entry on computer
> will be in one language but on the android data capture app will be
> another. In previous threads it was mentioned that from 2.24 the android
> app will read the displayX property for what it displays.
>
> My question: *Is it possible to change the displayFormName independently
> of the formName?* If so, how please? So far I have used xml updates and
> partial payload updates but to no avail. However simply changing the form
> name does the trick (which I don’t want to do.)
>
> Many thanks,
> Blake
>
> _______________________________________________
> 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
>
>


-- 
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
lars@xxxxxxxxx
http://www.dhis2.org <https://www.dhis2.org/>

Follow ups

References