Saigesp / json-translate

Translate json files with DeepL or AWS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[OSX] TypeError: argument of type 'NoneType' is not iterable

sbellver opened this issue · comments

Hi!

I'm on Mac, and I try to use this tool (thanks!)

  1. Clone repo from GitHub
  2. pip3 install -r requirements.txt
  3. vim .env (and write my API_KEY from DeepL free)
  4. python3 -m unittest discover --> Ok
  5. python3 main.py ~/git/myApp/src/i18n/es.json --locale en --output en.json
Traceback (most recent call last):
  File "/Users/sbellver/git/json-deepl-translate/main.py", line 262, in <module>
    main()
  File "/Users/sbellver/git/json-deepl-translate/main.py", line 255, in main
    results = get_strings_from_file(
  File "/Users/sbellver/git/json-deepl-translate/main.py", line 87, in get_strings_from_file
    return iterate_translate(
  File "/Users/sbellver/git/json-deepl-translate/main.py", line 108, in iterate_translate
    if key in skip:
TypeError: argument of type 'NoneType' is not iterable

Try with others like
python3 main.py ~/git/myApp/src/i18n/es.json --locale en --output en.json --indent 4 --sleep 0.5
with same result

Hi @sbellver

You are right, there was a bug with the skip argument if it was not defined. It is now fixed.

Thanks for the issue.