Program rules don't work properly when interface and database are changed to Arabic language

Dear colleagues ,
I am using DHIS2 version 2.38.1.1
I have some program rules for vaccination place in child routine immunization
for example if the previous vaccination place is at hospital or at this facility, then other data elements regarding vaccination in another facility should be hidden
as below

When the user with Arabic language interface and database try to capture data, the program rules for hiding other data elements does not work

WHY, Please ???

2 Likes

Hi Haliz,
Can you share your Program Rule details e.g. its Expression/Condition & Action/s?
AFAIK these work ok in the source language.

1 Like

Dear @dmnscar
please find below the program rule and its related expression and action

as for the data element to be hidden , which is written in arabic language that is another problem am facing. where the data element keep showing up in arabic even when i use english interface and database

Hi Haliz,
Thanks heaps for providing the extra info.
I have a hunch you have some DE names in both English & Arabic, as their default language, from looking at your PR Actions of ‘Hide field’ e.g. first of them in Arabic & then the second in EN with ‘HT_reasons_change_facility’?
If so this may be causing the problem but I can’t say 100%.
I would recommend reviewing your metadata & naming them all in English as the ‘System default’ language, then translating the objects to Arabic.
See how you go, but that is my reasoning to your problem.
Good luck mate

Dear @dmnscar as a matter of fact i have posted another problem here where am facing the problem with this particular DE of Other Facility were it keep showing in Arabic language while the DE details (Name, short name, description …etc) all in English but i translated it to Arabic and then i cannot get rid of its problems.

Hi @Haliz.t! Looking at the issue in the current post and the other one regarding the data elements, I am suspecting that somehow the Arabic name of a data element is actually stored under name and not under translation.

You can check the details of the data element using the api:
…api/dataElements/

Check what is stored under name and what is stored under translation.

There might be some other issues that you need to check:

  1. Cache (both cache cleaner and Data Administration/Maintenance/clear application cache)
  2. Program rule variables: type and translation. PRVs should not be translated.
  3. The issue with the the form names is affecting attributes, but not data elements. Here, both form names or names can be used.
  4. Check the system and user setting for language: db locale and Interface (UI) locale.

Let me know if this helps.

1 Like

Dear @YuryR
following your recommendation this is how the API for that data element look like and it seems that under english locale it is saved as arabic name , however am not good at using APIs, so would it be possible that you tell me how to fix it? with much appreciation

The issue is that the baseline name is in English:

“Name”: “HT_Other Facility”.

But then you have an English translation of the same data element property:

“property”: “NAME”, “locale”: “en”, “value”: “”

So, in order to solve the problem, you need to get rid of the English translation. In order to do this, you can use translation app, select the English locale and delete the en translation of the NAME, SHORT_NAME and FORM_NAME.

There is an option to do it with a 3-rd party app like postman or using command line. (GET and PUT commands).

See what you feel most comfortable with.
Let me know if it helps.

Yury Rogachev

1 Like

Dears @YuryR @dmnscar I would like to kindly inform you that this issue of program rule not working when translating Option sets and related options to Arabic language, has been solved thankfully by the kind support of @hanin.saadah
Below are the steps she mentioned thankfully…
For the Arabic translation issue, try this:

  1. All your meta data (data elements & option sets) should be in English
  2. Translate data elements & options or option sets to Arabic using translation feature (the user can convert to Arabic interface then the meta data will appear in Arabic)
  3. When you create the options inside option set make sure that the code is in English, and the code of the data element also, like the following for example:

  1. When you create the program rule, you should first create a program rule variable that is associated with specific data element, try to check and select the option “Use code for option set” and continue to build your program rules as usual but inside the rule expression you should put the code of the option or the code of the data element, not the display name.

So in general, the meta data should be in English, create what ever program rules you want based on the codes, then translate the meta data to which language you want.

Hope these steps can solve your problem.

@hanin.saadah …Cannot thank you enough… :rose:

4 Likes

Thank you so much dear @Haliz.t for sharing the solution, I’m very glad that it solved your problem and I’m more than happy to help.

Feel free to reach me anytime :smiling_face:

2 Likes

@Haliz.t …once this is merged then we will support use of option name as well.

1 Like