javinizer / Javinizer

(NSFW) Organize your local Japanese Adult Video (JAV) library
MIT License
566 stars 61 forks source link

Google Trans and Google Trans New doesn't works. #299

Closed EvilKing3 closed 2 years ago

EvilKing3 commented 2 years ago

Expected Behavior

Translating the description/plot.

Current Behavior

It doesn't translate anything.

Steps to Reproduce (for bugs)

"sort.metadata.nfo.translate": true, "sort.metadata.nfo.translate.module": "googletrans", or "google_trans_new" (tried both) "sort.metadata.nfo.translate.field": "plot", or "description" (tried both) "sort.metadata.nfo.translate.language": "en", "sort.metadata.nfo.translate.keeporiginaldescription": false,

Your Environment

jvlflame commented 2 years ago

I believe google_trans_new is currently non-functional, but googletrans is still working for me. Did you install the 4.0.0rc1 version of the module? The older versions are currently unsupported.

pip install googletrans==4.0.0rc1
EvilKing3 commented 2 years ago

Yes I have that version installed, I noticed that in the output file the description is called plot, so I tried to change it in the settings file but still doesn't works.

jvlflame commented 2 years ago

Keep it as description, not plot. Is your Python path set correctly? Open a pwsh terminal type python. image

You can also do a bit of troubleshooting directly with the translate script if you run it directly. image

  1. Run Javinizer -OpenModule and copy the module path
  2. Navigate to the module path in powershell with cd
  3. Run the translate.py script with python .\translate.py おはよう en
  4. Output the content of the temp path that the script returns with Get-Content [..path]

If any of the above steps fail, I'm sure we can figure out where it's not working.

EvilKing3 commented 2 years ago

Ok probably I've found the problem, but I have no clue on how to solve it, I did all the steps, on the first one python worked correctly (version 3.9.7) second step I've found the path, but when I tried to input the translate command the kanji character were bugged when inserted on powershell.. so I think that maybe the main problem: image

jvlflame commented 2 years ago

Go to your W10 settings, add the Japanese language, and then reboot. image

If that doesn't work, you can try changing your system locale to Japan as well.

EvilKing3 commented 2 years ago

Ok so I've added Japanese language pack to Windows 10, rebooted, tried again, no success, changed the locale to Japanese, rebooted, tried again, stil doesn't works. I decided to use the default PowerShell on windows and apparently it let me past Kanji there, but still doesn't works, probably because it works differently this powershell, but at least the kanji works: image

jvlflame commented 2 years ago

Oh, you need to add a space between the japanese letters and en.

python .\translate.py おはよう en

The list index is out of range because it's missing the second parameter.

Also, can you attach your settings file here. I can double check it for you to see if something is misconfigured.

EvilKing3 commented 2 years ago

You were right, I tried to translate with OpenShell 7, even if it still show the "unicode error" instead of the kanji, the translation works, I tried to do few JAV to test it, and it works fine now. Thanks I think I was missing the japanese locale it was probably the root of the problem <_<