Google Translate Error - Not a Cats issue in itsself. #318

Closed
opened 2025-03-26 10:15:32 +00:00 by Ghost · 2 comments
Ghost commented 2025-03-26 10:15:32 +00:00 (Migrated from git.disroot.org)

It seems that the Google API may of change and we may have to do a change to how Cats Translates now, see error below:

Python: Traceback (most recent call last):
  File "C:\Users\Rina\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\user_default\cats_blender_plugin\tools\translate.py", line 633, in update_dictionary
    translations = [translator.translate(text, lang_src='ja', lang_tgt='en').strip() for text in google_input]
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Rina\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\user_default\cats_blender_plugin\tools\translate.py", line 633, in <listcomp>
    translations = [translator.translate(text, lang_src='ja', lang_tgt='en').strip() for text in google_input]
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Rina\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\user_default\cats_blender_plugin\extern_tools\google_trans_new\google_trans_new.py", line 207, in translate
    raise e
  File "C:\Users\Rina\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\user_default\cats_blender_plugin\extern_tools\google_trans_new\google_trans_new.py", line 162, in translate
    response = json.loads(response[0][2])
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Blender Foundation\Blender 4.2\4.2\python\Lib\json\__init__.py", line 339, in loads
    raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType

This tell's me that something in google api may of changed and the google translate new plugin Cats uses needs to be updated, however this plugin has been abandoned for years so we would have to fix it ourselves. Not sure on the ETA on when we would fix this because we would need to learn what has changed first which means jumping into the google translate api which i hate...

It seems that the Google API may of change and we may have to do a change to how Cats Translates now, see error below: ``` Python: Traceback (most recent call last): File "C:\Users\Rina\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\user_default\cats_blender_plugin\tools\translate.py", line 633, in update_dictionary translations = [translator.translate(text, lang_src='ja', lang_tgt='en').strip() for text in google_input] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Rina\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\user_default\cats_blender_plugin\tools\translate.py", line 633, in <listcomp> translations = [translator.translate(text, lang_src='ja', lang_tgt='en').strip() for text in google_input] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Rina\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\user_default\cats_blender_plugin\extern_tools\google_trans_new\google_trans_new.py", line 207, in translate raise e File "C:\Users\Rina\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\user_default\cats_blender_plugin\extern_tools\google_trans_new\google_trans_new.py", line 162, in translate response = json.loads(response[0][2]) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Blender Foundation\Blender 4.2\4.2\python\Lib\json\__init__.py", line 339, in loads raise TypeError(f'the JSON object must be str, bytes or bytearray, ' TypeError: the JSON object must be str, bytes or bytearray, not NoneType ``` This tell's me that something in google api may of changed and the google translate new plugin Cats uses needs to be updated, however this plugin has been abandoned for years so we would have to fix it ourselves. Not sure on the ETA on when we would fix this because we would need to learn what has changed first which means jumping into the google translate api which i hate...
Ghost commented 2025-03-26 10:23:44 +00:00 (Migrated from git.disroot.org)

I have found a new plugin we can hopefully use, i may work on this later today.

I have found a new plugin we can hopefully use, i may work on this later today.
Ghost commented 2025-03-26 13:03:13 +00:00 (Migrated from git.disroot.org)

This has now been fixed in 4.2, 4.3 and 4.4 development branches and will be pushed out stable later today!

Closed as now fixed.

This has now been fixed in 4.2, 4.3 and 4.4 development branches and will be pushed out stable later today! Closed as now fixed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Kneelawk/Cats-Blender-Plugin#318
No description provided.