I am writing a little app to add German translations to Wanikani as user synonyms, based on the Wadoku dictionary (Doitsukani). Since some of the translations are fairly long, I truncate them to fit into the 64 byte limit. However, it seems that even at less than 64 bytes, Wanikani returns “Validation failed: Meaning synonyms 64 characters max for synonyms!”
For example, the following request fails for me, even though the longest synonym is 56 bytes according to my hex editor.
curl 'https://api.wanikani.com/v2/study_materials' \
-H 'Authorization: Bearer ...' \
-H 'Content-Type: application/json' \
--data-raw '{"study_material":{"subject_id":6488,"meaning_synonyms":["laut","gemäß","mittels","~ verdanken;dienen zu ~;kommen von ~;entsprechend;st~"]}}'
I am really calculating byte length of the UTF-8 string, not string length.
Does anyone have an idea what is going wrong here?
Good point! I was wondering about it at first, but @oldbonsai mentions in Updates to Synonyms on Item Pages “no more than eight, no more than 64 characters per synonym, no blank ones, no duplicate ones”. I was also able to successfully upload
Not just like this, someone would have to implement it. Currently, EDICT2 (~CSV) is expected, because that’s what a lot of dictionaries use. But there is a lot of post processing due to
Errors in the particular dictionary (different for each dictionary likely)
Managed to do somehow with help of chatgpt
Using Items id and translation values from excel converted to json and then with tamepermonkey script setting meaning_synonyms. Script took ~7h, with delays of 2s between items.