# Importing Translations with csv files

**URL:** <https://community.dhis2.org/t/importing-translations-with-csv-files/38796>\
**Category:** Support - Assistance technique\
**Tags:** translation\
**Created:** [25 March 2020 20:08 UTC](https://community.dhis2.org/t/importing-translations-with-csv-files/38796 "2020-03-25T20:08:48Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kristiyan\_Panayotov](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/kristiyan_panayotov/32/27214_2.png) [@Kristiyan\_Panayotov](https://community.dhis2.org/u/Kristiyan_Panayotov)\
**Post date:** [25 March 2020 20:08 UTC](https://community.dhis2.org/t/importing-translations-with-csv-files/38796/1 "2020-03-25T20:08:48Z")

</div>

Dear DHIS2 users,

We are looking for a way to mass import translation files in DHIS2 for various objects (Data element name, Options, Option sets, Program Stage Section Names, etc.). We used to do that in earlier versions, but in later ones, it was not supported. Now, this feature is introduced again in version 2.29.  
Our issue is that we cannot get a successful CSV import in our 2.29 DHIS2. The import files are based on the developer’s guide for the respected version and used to work fine in earlier versions. In all cases, we get no error, but just the “0” imported.

Do you have any experience in importing translations files (via CSV) in 2.29 or later versions?

An alternative can be a .json file, but our users will definitely prefer the .csv approach.

Thanks in advance.  
Kristiyan Panayotov

---

<div class="post-metadata">

**Author:** ![sgaudon](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/sgaudon/32/42928_2.png) [@sgaudon](https://community.dhis2.org/u/sgaudon)\
**Post date:** [26 March 2020 16:20 UTC](https://community.dhis2.org/t/importing-translations-with-csv-files/38796/2 "2020-03-26T16:20:28Z")

</div>

@stephocay @julhas @megankill @Eric_Munyambabazi@jomutsani Do you know any Translation import experts we can connect with? THANK YOU!

---

<div class="post-metadata">

**Author:** ![stephocay](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/stephocay/32/39615_2.png) [@stephocay](https://community.dhis2.org/u/stephocay)\
**Post date:** [26 March 2020 18:10 UTC](https://community.dhis2.org/t/importing-translations-with-csv-files/38796/3 "2020-03-26T18:10:01Z")

</div>

Hi Sara,

No one specific for the importation of translations but if the translations are readily available, it can be easily managed via API as described [here](https://docs.dhis2.org/2.33/en/developer/html/webapi_translations.html)

Thanks

---

<div class="post-metadata">

**Author:** ![Georgi](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/g/f0a364/32.png) [@Georgi](https://community.dhis2.org/u/Georgi)\
**Post date:** [27 March 2020 09:13 UTC](https://community.dhis2.org/t/importing-translations-with-csv-files/38796/4 "2020-03-27T09:13:13Z")

</div>

@stephocay,

Thanks for your response! How can we quickly build the json file out of an excel with translations?  
We have nearly 400 data elements (names, short names, form name, description) + option sets + Stage sections…

Georgi

---

<div class="post-metadata">

**Author:** ![stephocay](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/stephocay/32/39615_2.png) [@stephocay](https://community.dhis2.org/u/stephocay)\
**Post date:** [27 March 2020 09:37 UTC](https://community.dhis2.org/t/importing-translations-with-csv-files/38796/5 "2020-03-27T09:37:19Z")

</div>

Hi @Georgi,

You can use this online tool that will convert your metadata from csv to json

> **[CSV To JSON Converter](https://www.convertcsv.com/csv-to-json.htm)**
>
> Convert CSV data to JSON. TSV to JSON

Save your excel as csv and upload the csv file. You will then need to update the json file to define the DHIS2 objects like dataElements.

Regards

---

<div class="post-metadata">

**Author:** ![Georgi](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/g/f0a364/32.png) [@Georgi](https://community.dhis2.org/u/Georgi)\
**Post date:** [27 March 2020 09:57 UTC](https://community.dhis2.org/t/importing-translations-with-csv-files/38796/6 "2020-03-27T09:57:07Z")

</div>

Hi @stephocay,

Thanks, yes I found this converter. Works nice.  
Can you give me a quick guidance on how to post the json trhought the API?  
When I used this command: [PIIRS (CARE International)](https://dev.piirs.care.org/POST%20/api/26/translations) I get an Error message

 ![image](https://dhis2.b-cdn.net/uploads/default/original/3X/c/4/c4e085ea056c8e1a2ded8952b41370f2b505cee8.png)

Do I need to enable some permissions or am I posting the command wrong?

Georgi

---

<div class="post-metadata">

**Author:** ![stephocay](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/stephocay/32/39615_2.png) [@stephocay](https://community.dhis2.org/u/stephocay)\
**Post date:** [27 March 2020 10:20 UTC](https://community.dhis2.org/t/importing-translations-with-csv-files/38796/7 "2020-03-27T10:20:05Z")

</div>

Ig @Georgi Chakarov ,

If you have formatted the JSON file correctly, you can just import using the DHIS2 import export app

regards

---

<div class="post-metadata">

**Author:** ![Georgi](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/g/f0a364/32.png) [@Georgi](https://community.dhis2.org/u/Georgi)\
**Post date:** [28 March 2020 08:17 UTC](https://community.dhis2.org/t/importing-translations-with-csv-files/38796/8 "2020-03-28T08:17:53Z")

</div>

@stephocay,

I have tried multiple versions of json format, but none worked through the import export app.  
I aslo tried using postman to POST translations, as per the instructions in the guide - still unsuccessful. Any guidance that you can send over? I am also available for a chat any time this weekend. We are a bit in a rush.

Georgi

---

<div class="post-metadata">

**Author:** ![stephocay](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/stephocay/32/39615_2.png) [@stephocay](https://community.dhis2.org/u/stephocay)\
**Post date:** [28 March 2020 21:21 UTC](https://community.dhis2.org/t/importing-translations-with-csv-files/38796/9 "2020-03-28T21:21:07Z")

</div>

Hi Georgi, may I have a look at the format of the json file you are trying to posts. As I indicated earlier, the translations are now part of the metadata objects e.g. data elements etc. so to import them, you will be required to import the objects with the objects together.

{  
“dataElements”: [  
{  
“code”: “033B-AP01”,  
“lastUpdated”: “2020-03-11T13:04:53.877”,  
“id”: “NeKm5EvaJYf”,  
“href”: “[https://htm-repo.dev.hispuganda.org/api/dataElements/NeKm5EvaJYf](https://htm-repo.dev.hispuganda.org/api/dataElements/NeKm5EvaJYf)”,  
“created”: “2020-03-11T13:04:53.817”,  
“name”: “033B-AP01. OPD New”,  
“shortName”: “033B-AP01. OPD New”,  
“aggregationType”: “SUM”,  
“domainType”: “AGGREGATE”,  
“displayName”: “033B-AP01. OPD New”,  
“publicAccess”: “rw------”,  
“description”: “033B-AP01. OPD New”,  
“displayShortName”: “033B-AP01. OPD New”,  
“externalAccess”: false,  
“valueType”: “INTEGER\_ZERO\_OR\_POSITIVE”,  
“formName”: “033B-AP01. OPD New”,  
“displayDescription”: “033B-AP01. OPD New”,  
“dimensionItem”: “NeKm5EvaJYf”,  
“displayFormName”: “033B-AP01. OPD New”,  
“zeroIsSignificant”: true,  
“favorite”: false,  
“optionSetValue”: false,  
“dimensionItemType”: “DATA\_ELEMENT”,  
“access”: {  
“read”: true,  
“update”: true,  
“externalize”: true,  
“delete”: true,  
“write”: true,  
“manage”: true  
},  
“categoryCombo”: {  
“id”: “bjDvmb4bfuf”  
},  
“lastUpdatedBy”: {  
“id”: “M5zQapPyTZI”  
},  
“user”: {  
“id”: “M5zQapPyTZI”  
},  
“favorites”: [],  
“dataSetElements”: [  
{  
“dataElement”: {  
“id”: “NeKm5EvaJYf”  
},  
“dataSet”: {  
“id”: “S84cwAtAf5z”  
}  
}  
],  
**“translations”: [],**  
“userGroupAccesses”: [],  
“dataElementGroups”: [],  
“attributeValues”: [],  
“userAccesses”: [],  
“legendSets”: [],  
“aggregationLevels”: []  
}  
]  
}

Notice the highlighted section of translations is where where you put the translations

See Below:

{  
“dataElements”: [  
{  
“code”: “033B-AP01”,  
“lastUpdated”: “2020-03-11T13:04:53.877”,  
“id”: “NeKm5EvaJYf”,  
“href”: “[https://htm-repo.dev.hispuganda.org/api/dataElements/NeKm5EvaJYf](https://htm-repo.dev.hispuganda.org/api/dataElements/NeKm5EvaJYf)”,  
“created”: “2020-03-11T13:04:53.817”,  
“name”: “033B-AP01. OPD New”,  
“shortName”: “033B-AP01. OPD New”,  
“aggregationType”: “SUM”,  
“domainType”: “AGGREGATE”,  
“displayName”: “033B-AP01. OPD New”,  
“publicAccess”: “rw------”,  
“description”: “033B-AP01. OPD New”,  
“displayShortName”: “033B-AP01. OPD New”,  
“externalAccess”: false,  
“valueType”: “INTEGER\_ZERO\_OR\_POSITIVE”,  
“formName”: “033B-AP01. OPD New”,  
“displayDescription”: “033B-AP01. OPD New”,  
“dimensionItem”: “NeKm5EvaJYf”,  
“displayFormName”: “033B-AP01. OPD New”,  
“zeroIsSignificant”: true,  
“favorite”: false,  
“optionSetValue”: false,  
“dimensionItemType”: “DATA\_ELEMENT”,  
“access”: {  
“read”: true,  
“update”: true,  
“externalize”: true,  
“delete”: true,  
“write”: true,  
“manage”: true  
},  
“categoryCombo”: {  
“id”: “bjDvmb4bfuf”  
},  
“lastUpdatedBy”: {  
“id”: “M5zQapPyTZI”  
},  
“user”: {  
“id”: “M5zQapPyTZI”  
},  
“favorites”: [],  
“dataSetElements”: [  
{  
“dataElement”: {  
“id”: “NeKm5EvaJYf”  
},  
“dataSet”: {  
“id”: “S84cwAtAf5z”  
}  
}  
],  
**“translations”: [**  
{  
“property”: “SHORT\_NAME”,  
“locale”: “fr”,  
“value”: “OPD Nouveau”  
},  
{  
“property”: “NAME”,  
“locale”: “fr”,  
“value”: “033B-AP01. OPD Nouveau”  
}  
**],**  
“userGroupAccesses”: [],  
“dataElementGroups”: [],  
“attributeValues”: [],  
“userAccesses”: [],  
“legendSets”: [],  
“aggregationLevels”: []  
}  
]  
}

---

<div class="post-metadata">

**Author:** ![Georgi](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/g/f0a364/32.png) [@Georgi](https://community.dhis2.org/u/Georgi)\
**Post date:** [29 March 2020 06:21 UTC](https://community.dhis2.org/t/importing-translations-with-csv-files/38796/10 "2020-03-29T06:21:24Z")

</div>

Hi Stephen,

Thanks for the response! I have been trying to import the format below and some variations of it, like removing the square brackets, etc. So you are saying that I need to create a json file with all the details of the data elements and import back? I will give it a shot.

[  
{  
“objectId”: “F10ZOcwHvTv”,  
“className”: “dataElement”,  
“locale”: “es”,  
“property”: “name”,  
“value”: “Otra modalidad”  
}  
]

---

<div class="post-metadata">

**Author:** ![Georgi](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/g/f0a364/32.png) [@Georgi](https://community.dhis2.org/u/Georgi)\
**Post date:** [29 March 2020 07:25 UTC](https://community.dhis2.org/t/importing-translations-with-csv-files/38796/11 "2020-03-29T07:25:56Z")

</div>

Hi again Stephen,

So this is what I did:

1. I downloaded metadata in json for my Data elements
2. Isolated one data element and populated the values in the translation brackets
3. Imported back
4. The import result gives me that 1 item has been updated, but when I go to the data element itself there is no translation value.

See below the json format itself.

 ![image](https://dhis2.b-cdn.net/uploads/default/original/3X/d/c/dce281e3e35e8f1f12b4319cfc4d97de9dc0a856.png)

{  
“dataElements”: [  
{  
“code”: “hum\_edu\_dir”,  
“lastUpdated”: “2020-03-17T09:56:07.433”,  
“id”: “iND9UwEytPL”,  
“created”: “2020-03-17T09:56:07.338”,  
“name”: “Humanitarian - Direct participants reached in the FY (Education)”,  
“shortName”: “Hum-Direct participants reached (Education)”,  
“aggregationType”: “SUM”,  
“domainType”: “TRACKER”,  
“publicAccess”: “rw------”,  
“description”: “”,  
“valueType”: “INTEGER\_ZERO\_OR\_POSITIVE”,  
“formName”: "Education: Direct participants \nreached in the FY ",  
“zeroIsSignificant”: false,  
“categoryCombo”: {  
“id”: “bjDvmb4bfuf”  
},  
“lastUpdatedBy”: {  
“id”: “zkApVOpQQNd”  
},  
“user”: {  
“id”: “zkApVOpQQNd”  
},  
“translations”: [  
{  
“property”: “NAME”,  
“locale”: “es”,  
“value”: “Desarrollo - Participantes directos alcanzados en el año fiscal (Educación)”  
},  
{  
“property”: “SHORT\_NAME”,  
“locale”: “es”,  
“value”: “Des-Partic directos Educación”  
},  
{  
“property”: “FORM\_NAME”,  
“locale”: “es”,  
“value”: “Educación: Participantes directos alcanzados en el año fiscal”  
},  
{  
“property”: “”,  
“locale”: “”,  
“value”: “”  
},  
{  
“property”: “”,  
“locale”: “”,  
“value”: “”  
},  
{  
“property”: “”,  
“locale”: “”,  
“value”: “”  
},  
{  
“property”: “”,  
“locale”: “”,  
“value”: “”  
},  
{  
“property”: “”,  
“locale”: “”,  
“value”: “”  
}  
],  
“optionSet”: {  
“id”: “”  
}  
}  
]  
}
