Saigesp / json-translate

Translate json files with DeepL or AWS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tool does not translate data in arrays

xelayz opened this issue · comments

commented

Hello,

I need to translate a big json file with a lot of arrays. But the tool only translate the text outside the arrays.

{ "locale": "de", "questions": [ { "question": "Was versteht man unter defensivem Fahren?", "possibleAnswers": [ { "text": "Nicht auf dem eigenen Recht bestehen", "isCorrect": true }, { "text": "Mit Fehlern anderer rechnen", "isCorrect": true }, { "text": "Vorsorglich an jeder Kreuzung anhalten", "isCorrect": false } ] },

Only "de" get translated. It is not possible for Jsoniter to parse arrays? Is there a workaround?

Thanks!

Hey @xelayz

This project is intended to work with translation files, which are structured as key-value json files.

However, you can do a fork and modify the json_iterator function in main.py by adding the case if type(value) == type(list())