API for pulling Multilingual Labels?

Hi - as part of some of the apps that we are coding, as well as 7 complex custom forms that we are about to build (they will have some JScript for logic), we will need both (apps and forms) in 3 languages (total 21 forms if we use the current way of doing things).

Does the current metadata API has a function to retrieve multilingual values?

What we are looking is the possibility to retrieve the Name, Form Name or Short Name of a DataElement, Category or Option Set in the current-user language by passing the UID or Code.

If this functionality doesn’t exist at the moment:

  • Should it be added to the metadata api?

  • Should it be part of the Categories/ Data Elements/ api?

PSI will be happy to contribute on the development of this under your guidance.

Rodolfo

Hi Rodolfo,

We already have a blueprint for this (for 2.14, but it has not been assigned yet). You can see it at [1].

Do you need multiple translation for a single user, or is it enough that data-element names etc returned are in the users db-locale?

[1] https://blueprints.launchpad.net/dhis2/+spec/i18n-in-web-api

···


Morten

On Fri, Dec 6, 2013 at 12:55 PM, Rodolfo Melia rmelia@knowming.com wrote:

Hi - as part of some of the apps that we are coding, as well as 7 complex custom forms that we are about to build (they will have some JScript for logic), we will need both (apps and forms) in 3 languages (total 21 forms if we use the current way of doing things).

Does the current metadata API has a function to retrieve multilingual values?

What we are looking is the possibility to retrieve the Name, Form Name or Short Name of a DataElement, Category or Option Set in the current-user language by passing the UID or Code.

If this functionality doesn’t exist at the moment:

  • Should it be added to the metadata api?
  • Should it be part of the Categories/ Data Elements/ api?

PSI will be happy to contribute on the development of this under your guidance.

Rodolfo


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

Hi Morten. We just need the labels to be returned in the user language. If James can do this, please assign it to him.

Rodolfo Meliá

+44 777 576 4090 | +1 708 872-7636

Please ignore any typos on this email sent from my mobile, probably written while I was at the park with the kids, at the airport walking to the gate, or sleepless (although exhausted). Grammatical faults? I’m sorry- I do my best

···


Morten

On Fri, Dec 6, 2013 at 12:55 PM, Rodolfo Melia rmelia@knowming.com wrote:

Hi - as part of some of the apps that we are coding, as well as 7 complex custom forms that we are about to build (they will have some JScript for logic), we will need both (apps and forms) in 3 languages (total 21 forms if we use the current way of doing things).

Does the current metadata API has a function to retrieve multilingual values?

What we are looking is the possibility to retrieve the Name, Form Name or Short Name of a DataElement, Category or Option Set in the current-user language by passing the UID or Code.

If this functionality doesn’t exist at the moment:

  • Should it be added to the metadata api?
  • Should it be part of the Categories/ Data Elements/ api?

PSI will be happy to contribute on the development of this under your guidance.

Rodolfo


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

Hi Rodolfo,

will try to get this done for 2.14. Its a bit tricky - will have to ponder a bit how to solve it since it affects the whole api. I think we simply returns the regular objects translated depending on the currently authenticated user - no extra feature/resource.

https://blueprints.launchpad.net/dhis2/+spec/i18n-in-web-api

cheers

Lars

···

On Fri, Dec 6, 2013 at 5:45 PM, Rodolfo Melia rmelia@knowming.com wrote:

Hi Morten. We just need the labels to be returned in the user language. If James can do this, please assign it to him.

Rodolfo Meliá

+44 777 576 4090 | +1 708 872-7636

Please ignore any typos on this email sent from my mobile, probably written while I was at the park with the kids, at the airport walking to the gate, or sleepless (although exhausted). Grammatical faults? I’m sorry- I do my best

On 6 Dec 2013, at 15:35, Morten Olav Hansen mortenoh@gmail.com wrote:

Hi Rodolfo,

We already have a blueprint for this (for 2.14, but it has not been assigned yet). You can see it at [1].

Do you need multiple translation for a single user, or is it enough that data-element names etc returned are in the users db-locale?

[1] https://blueprints.launchpad.net/dhis2/+spec/i18n-in-web-api


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


Morten

On Fri, Dec 6, 2013 at 12:55 PM, Rodolfo Melia rmelia@knowming.com wrote:

Hi - as part of some of the apps that we are coding, as well as 7 complex custom forms that we are about to build (they will have some JScript for logic), we will need both (apps and forms) in 3 languages (total 21 forms if we use the current way of doing things).

Does the current metadata API has a function to retrieve multilingual values?

What we are looking is the possibility to retrieve the Name, Form Name or Short Name of a DataElement, Category or Option Set in the current-user language by passing the UID or Code.

If this functionality doesn’t exist at the moment:

  • Should it be added to the metadata api?
  • Should it be part of the Categories/ Data Elements/ api?

PSI will be happy to contribute on the development of this under your guidance.

Rodolfo


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

I can see that you are thinking about the whole metadata model - nice.
All we seek to get back is the label on the current user locale, and we only need Categories, Data Elements and Data Set Sections labels at this stage.

Also, when you are in a custom form - how can you know what language is the current user set to?

I imagine needing to add some extra text, which will need multiple translations. We can embed such text on the HTML of the page, as long as we know what’s the current language, and then display accordingly.

R

···

Rodolfo Meliá

*Principal | *rmelia@knowming.com

Skype: rod.melia | +44 777 576 4090 | +1 708 872 7636

www.knowming.com

On Mon, Dec 9, 2013 at 6:47 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Rodolfo,

will try to get this done for 2.14. Its a bit tricky - will have to ponder a bit how to solve it since it affects the whole api. I think we simply returns the regular objects translated depending on the currently authenticated user - no extra feature/resource.

https://blueprints.launchpad.net/dhis2/+spec/i18n-in-web-api

cheers

Lars

On Fri, Dec 6, 2013 at 5:45 PM, Rodolfo Melia rmelia@knowming.com wrote:

Hi Morten. We just need the labels to be returned in the user language. If James can do this, please assign it to him.

Rodolfo Meliá

+44 777 576 4090 | +1 708 872-7636

Please ignore any typos on this email sent from my mobile, probably written while I was at the park with the kids, at the airport walking to the gate, or sleepless (although exhausted). Grammatical faults? I’m sorry- I do my best

On 6 Dec 2013, at 15:35, Morten Olav Hansen mortenoh@gmail.com wrote:

Hi Rodolfo,

We already have a blueprint for this (for 2.14, but it has not been assigned yet). You can see it at [1].

Do you need multiple translation for a single user, or is it enough that data-element names etc returned are in the users db-locale?

[1] https://blueprints.launchpad.net/dhis2/+spec/i18n-in-web-api


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


Morten

On Fri, Dec 6, 2013 at 12:55 PM, Rodolfo Melia rmelia@knowming.com wrote:

Hi - as part of some of the apps that we are coding, as well as 7 complex custom forms that we are about to build (they will have some JScript for logic), we will need both (apps and forms) in 3 languages (total 21 forms if we use the current way of doing things).

Does the current metadata API has a function to retrieve multilingual values?

What we are looking is the possibility to retrieve the Name, Form Name or Short Name of a DataElement, Category or Option Set in the current-user language by passing the UID or Code.

If this functionality doesn’t exist at the moment:

  • Should it be added to the metadata api?
  • Should it be part of the Categories/ Data Elements/ api?

PSI will be happy to contribute on the development of this under your guidance.

Rodolfo


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

I can see that you are thinking about the whole metadata model - nice.

That's the idea - thanks.

All we seek to get back is the label on the current user locale, and we
only need Categories, Data Elements and Data Set Sections labels at this
stage.

Okay. We plan to make this generic so it applies to all objects which
current support translations.

Also, when you are in a custom form - how can you know what language is
the current user set to?

I imagine needing to add some extra text, which will need multiple

translations. We can embed such text on the HTML of the page, as long as we
know what's the current language, and then display accordingly.

Good point. That and other user settings should be easily available in the
web api, probably at /api/me. Will try to fix that shortly.

cheers

Lars

···

On Thu, Dec 12, 2013 at 12:32 AM, Rodolfo Melia <rmelia@knowming.com> wrote:

Also, when you are in a custom form - how can you know what language is
the current user set to?

I imagine needing to add some extra text, which will need multiple

translations. We can embed such text on the HTML of the page, as long as we
know what's the current language, and then display accordingly.

Good point. That and other user settings should be easily available in the
web api, probably at /api/me. Will try to fix that shortly.

Hi Rodolfo and James,

you can now access settings for the currently logged in user at:

/api/me/profile

{

   - firstName: "Tom",
   - surname: "Wakiki",
   - ...
   - settings:
   {
      - keyMessageEmailNotification: "false",
      - keyUiLocale: "en",
      - keyDbLocale: "en",
      - keyMessageSmsNotification: "false"
      }

}

Lars

Thanks Lars - I didn’t know about the ‘me’ api…

R

···

Rodolfo Meliá

*Principal | *rmelia@knowming.com

Skype: rod.melia | +44 777 576 4090 | +1 708 872 7636

www.knowming.com

On Sat, Dec 14, 2013 at 1:19 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Rodolfo and James,

you can now access settings for the currently logged in user at:

/api/me/profile

{

  • firstName: “Tom”,

  • surname: “Wakiki”,

  • settings:

    {

    • keyMessageEmailNotification: “false”,

    • keyUiLocale: “en”,

    • keyDbLocale: “en”,

    • keyMessageSmsNotification: “false”

    }

}

Lars

Also, when you are in a custom form - how can you know what language is the current user set to?

I imagine needing to add some extra text, which will need multiple translations. We can embed such text on the HTML of the page, as long as we know what’s the current language, and then display accordingly.

Good point. That and other user settings should be easily available in the web api, probably at /api/me. Will try to fix that shortly.

Hi Lars - we were about to use the locale values on api/me, but the info is not being returned. We tried Sierra Leone demo as well as dev - somehow is gone. Would it be possible to get this back? Thanks !

···

Rodolfo Meliá

*Principal | *rmelia@knowming.com

Skype: rod.melia | +44 777 576 4090 | +1 708 872 7636

www.knowming.com

On Sat, Dec 14, 2013 at 1:19 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Rodolfo and James,

you can now access settings for the currently logged in user at:

/api/me/profile

{

  • firstName: “Tom”,

  • surname: “Wakiki”,

  • settings:

    {

    • keyMessageEmailNotification: “false”,

    • keyUiLocale: “en”,

    • keyDbLocale: “en”,

    • keyMessageSmsNotification: “false”

    }

}

Lars

Also, when you are in a custom form - how can you know what language is the current user set to?

I imagine needing to add some extra text, which will need multiple translations. We can embed such text on the HTML of the page, as long as we know what’s the current language, and then display accordingly.

Good point. That and other user settings should be easily available in the web api, probably at /api/me. Will try to fix that shortly.

Its actually this resource URL:

api/me/profile

···

On Wed, Jan 15, 2014 at 12:49 PM, Rodolfo Melia rmelia@knowming.com wrote:

Hi Lars - we were about to use the locale values on api/me, but the info is not being returned. We tried Sierra Leone demo as well as dev - somehow is gone. Would it be possible to get this back? Thanks !

Rodolfo Meliá

*Principal | *rmelia@knowming.com

Skype: rod.melia | +44 777 576 4090 | +1 708 872 7636

www.knowming.com

On Sat, Dec 14, 2013 at 1:19 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Rodolfo and James,

you can now access settings for the currently logged in user at:

/api/me/profile

{

  • firstName: “Tom”,

  • surname: “Wakiki”,

  • settings:

    {

    • keyMessageEmailNotification: “false”,

    • keyUiLocale: “en”,

    • keyDbLocale: “en”,

    • keyMessageSmsNotification: “false”

    }

}

Lars

Also, when you are in a custom form - how can you know what language is the current user set to?

I imagine needing to add some extra text, which will need multiple translations. We can embed such text on the HTML of the page, as long as we know what’s the current language, and then display accordingly.

Good point. That and other user settings should be easily available in the web api, probably at /api/me. Will try to fix that shortly.

Thanks Lars - I can now see this working on 2.14. Would it be possible to back port it to 2.13? Otherwise we will wait to late march, when we have scheduled our upgrade of the production server.

R

···

Rodolfo Meliá

*Principal | *rmelia@knowming.com

Skype: rod.melia | +44 777 576 4090 | +1 708 872 7636

www.knowming.com

On Wed, Jan 15, 2014 at 12:10 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Its actually this resource URL:

api/me/profile

On Wed, Jan 15, 2014 at 12:49 PM, Rodolfo Melia rmelia@knowming.com wrote:

Hi Lars - we were about to use the locale values on api/me, but the info is not being returned. We tried Sierra Leone demo as well as dev - somehow is gone. Would it be possible to get this back? Thanks !

Rodolfo Meliá

*Principal | *rmelia@knowming.com

Skype: rod.melia | +44 777 576 4090 | +1 708 872 7636

www.knowming.com

On Sat, Dec 14, 2013 at 1:19 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Rodolfo and James,

you can now access settings for the currently logged in user at:

/api/me/profile

{

  • firstName: “Tom”,

  • surname: “Wakiki”,

  • settings:

    {

    • keyMessageEmailNotification: “false”,

    • keyUiLocale: “en”,

    • keyDbLocale: “en”,

    • keyMessageSmsNotification: “false”

    }

}

Lars

Also, when you are in a custom form - how can you know what language is the current user set to?

I imagine needing to add some extra text, which will need multiple translations. We can embed such text on the HTML of the page, as long as we know what’s the current language, and then display accordingly.

Good point. That and other user settings should be easily available in the web api, probably at /api/me. Will try to fix that shortly.

Hi Rodolfo,

I have back-ported the fix to 2.13 now.

regards,

Lars

···

On Wed, Jan 15, 2014 at 2:06 PM, Rodolfo Melia rmelia@knowming.com wrote:

R

Thanks Lars - I can now see this working on 2.14. Would it be possible to back port it to 2.13? Otherwise we will wait to late march, when we have scheduled our upgrade of the production server.

Rodolfo Meliá

*Principal | *rmelia@knowming.com

Skype: rod.melia | +44 777 576 4090 | +1 708 872 7636

www.knowming.com

On Wed, Jan 15, 2014 at 12:10 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Its actually this resource URL:

api/me/profile

On Wed, Jan 15, 2014 at 12:49 PM, Rodolfo Melia rmelia@knowming.com wrote:

Hi Lars - we were about to use the locale values on api/me, but the info is not being returned. We tried Sierra Leone demo as well as dev - somehow is gone. Would it be possible to get this back? Thanks !

Rodolfo Meliá

*Principal | *rmelia@knowming.com

Skype: rod.melia | +44 777 576 4090 | +1 708 872 7636

www.knowming.com

On Sat, Dec 14, 2013 at 1:19 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Rodolfo and James,

you can now access settings for the currently logged in user at:

/api/me/profile

{

  • firstName: “Tom”,

  • surname: “Wakiki”,

  • settings:

    {

    • keyMessageEmailNotification: “false”,

    • keyUiLocale: “en”,

    • keyDbLocale: “en”,

    • keyMessageSmsNotification: “false”

    }

}

Lars

Also, when you are in a custom form - how can you know what language is the current user set to?

I imagine needing to add some extra text, which will need multiple translations. We can embed such text on the HTML of the page, as long as we know what’s the current language, and then display accordingly.

Good point. That and other user settings should be easily available in the web api, probably at /api/me. Will try to fix that shortly.

thanks so much lars.

Thuy/ James: the next update to our production server is schedule for next sunday. I should be ok to wait until them.

···

Rodolfo Meliá

*Principal | *rmelia@knowming.com

Skype: rod.melia | +44 777 576 4090 | +1 708 872 7636

www.knowming.com

On Sun, Jan 19, 2014 at 7:21 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Rodolfo,

I have back-ported the fix to 2.13 now.

regards,

Lars

On Wed, Jan 15, 2014 at 2:06 PM, Rodolfo Melia rmelia@knowming.com wrote:

R

Thanks Lars - I can now see this working on 2.14. Would it be possible to back port it to 2.13? Otherwise we will wait to late march, when we have scheduled our upgrade of the production server.

Rodolfo Meliá

*Principal | *rmelia@knowming.com

Skype: rod.melia | +44 777 576 4090 | +1 708 872 7636

www.knowming.com

On Wed, Jan 15, 2014 at 12:10 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Its actually this resource URL:

api/me/profile

On Wed, Jan 15, 2014 at 12:49 PM, Rodolfo Melia rmelia@knowming.com wrote:

Hi Lars - we were about to use the locale values on api/me, but the info is not being returned. We tried Sierra Leone demo as well as dev - somehow is gone. Would it be possible to get this back? Thanks !

Rodolfo Meliá

*Principal | *rmelia@knowming.com

Skype: rod.melia | +44 777 576 4090 | +1 708 872 7636

www.knowming.com

On Sat, Dec 14, 2013 at 1:19 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Rodolfo and James,

you can now access settings for the currently logged in user at:

/api/me/profile

{

  • firstName: “Tom”,

  • surname: “Wakiki”,

  • settings:

    {

    • keyMessageEmailNotification: “false”,

    • keyUiLocale: “en”,

    • keyDbLocale: “en”,

    • keyMessageSmsNotification: “false”

    }

}

Lars

Also, when you are in a custom form - how can you know what language is the current user set to?

I imagine needing to add some extra text, which will need multiple translations. We can embed such text on the HTML of the page, as long as we know what’s the current language, and then display accordingly.

Good point. That and other user settings should be easily available in the web api, probably at /api/me. Will try to fix that shortly.

Dears,
I haven’t checked in DHIS 2.14

But on DHIS 2.13 the returned value is not an object, it is a string.

So right now I need to build a json object with the returned value.

I think if it’s default to return as a json object. It should be better.

···

2014/1/20 Rodolfo Melia rmelia@knowming.com

thanks so much lars.

Thuy/ James: the next update to our production server is schedule for next sunday. I should be ok to wait until them.


Thai Chuong
HCMUT - Computer science and engineering Faculty

Website: http://thuytruc.net

YM/Skype : thaichuong159
Email: thaichuong159@gmail.com
Phone: (+84) 918776134

Rodolfo Meliá

*Principal | *rmelia@knowming.com

Skype: rod.melia | +44 777 576 4090 | +1 708 872 7636

www.knowming.com

On Sun, Jan 19, 2014 at 7:21 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Rodolfo,

I have back-ported the fix to 2.13 now.

regards,

Lars

On Wed, Jan 15, 2014 at 2:06 PM, Rodolfo Melia rmelia@knowming.com wrote:

R

Thanks Lars - I can now see this working on 2.14. Would it be possible to back port it to 2.13? Otherwise we will wait to late march, when we have scheduled our upgrade of the production server.

Rodolfo Meliá

*Principal | *rmelia@knowming.com

Skype: rod.melia | +44 777 576 4090 | +1 708 872 7636

www.knowming.com

On Wed, Jan 15, 2014 at 12:10 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Its actually this resource URL:

api/me/profile

On Wed, Jan 15, 2014 at 12:49 PM, Rodolfo Melia rmelia@knowming.com wrote:

Hi Lars - we were about to use the locale values on api/me, but the info is not being returned. We tried Sierra Leone demo as well as dev - somehow is gone. Would it be possible to get this back? Thanks !

Rodolfo Meliá

*Principal | *rmelia@knowming.com

Skype: rod.melia | +44 777 576 4090 | +1 708 872 7636

www.knowming.com

On Sat, Dec 14, 2013 at 1:19 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Rodolfo and James,

you can now access settings for the currently logged in user at:

/api/me/profile

{

  • firstName: “Tom”,

  • surname: “Wakiki”,

  • settings:

    {

    • keyMessageEmailNotification: “false”,

    • keyUiLocale: “en”,

    • keyDbLocale: “en”,

    • keyMessageSmsNotification: “false”

    }

}

Lars

Also, when you are in a custom form - how can you know what language is the current user set to?

I imagine needing to add some extra text, which will need multiple translations. We can embed such text on the HTML of the page, as long as we know what’s the current language, and then display accordingly.

Good point. That and other user settings should be easily available in the web api, probably at /api/me. Will try to fix that shortly.