mololab / json-translator

jsontt 💡 - AI JSON Translator + other FREE translation modules to translate your json/yaml files into other languages ✅ Check Readme ✌
https://mololab.org/jsontt/npm
MIT License
427 stars 53 forks source link

Error While Translating: Assigned "--" #31

Open psarno opened 1 year ago

psarno commented 1 year ago

Why does this have so many issues on what are seemingly simple words to translate?

I picked English as my source and Spanish/French as my destination languages.

It can't translate things like "Company Name" or even "Notifications", "Run", "Start Date", etc.

These aren't highly technical terms or anything ... is there something I'm missing or is this just a limitation?

image

israel-kochava commented 1 year ago

I have the same issue. I thought going back a version or two might fix it as I just updated to 1.6.4 but no such luck as it appears Google has moved their translation requests. I'll follow this to see if anything happens. Cheers

Screenshot 2023-06-08 at 1 00 26 PM

TakiGuan commented 1 year ago

Have the same situation. I'm not sure if the current free API call exceeds the max limit.

yaakov-jgrp commented 1 year ago

same here, not working :(

ParvinEyvazov commented 1 year ago

which translation service are you using? @JGRP-DEV @TakiGuan @israel-kochava @psarno

yaakov-jgrp commented 1 year ago

@ParvinEyvazov I tried with Google & Bing.

ParvinEyvazov commented 1 year ago

@JGRP-DEV It is having an issue while parsing your json file. Can you please paste your entire json to https://jsonformatter.org , Click Format / Beautify and see if its in valid form or not.

yaakov-jgrp commented 1 year ago

It is valid, now getting the same previous error.

israel-kochava commented 1 year ago

I did a fresh install and the latest "@parvineyvazov/json-translator": "^1.7.0", it seems to be working again

ParvinEyvazov commented 1 year ago

@JGRP-DEV can you please try the latest version which is 1.7.0

cevaris commented 1 year ago

same error while translating issue.

yarn run jsontt src/lang/en.json --translator google --from en --to ja es
...
° Translating. Please wait. 12 of 14 translated.
error while translating
        "Start Daily Game"
assigned "--" instead of exit from cli.

error while translating
        "won!"
assigned "--" instead of exit from cli.
✔ DONE! 14 of 14 translated.
 All files are created! You can find them in the same folder as the original JSON file.
 For Spanish --> es.json created.
 For Japanese --> ja.json created.

Result lang.json file has all the keys but -- for values.

Source en.json file is valid.

{
  "main.game_finished.header": "You",
  "main.game_finished.lost": "lost",
  "main.game_finished.play_gain": "Play Again",
  "main.game_finished.score_time": "Score: {time_ms}ms",
  "main.game_finished.won": "won!",
  "main.start_menu.start_daily_game": "Start Daily Game",
  "main.start_menu.start_practice_game": "Start Practice Game"
}

Running the latest @parvineyvazov/json-translator package

"@parvineyvazov/json-translator@^1.7.0":
  version "1.7.0"
  resolved "https://registry.yarnpkg.com/@parvineyvazov/json-translator/-/json-translator-1.7.0.tgz#37c1390af3b86783bb9f661cdfad65851c8b7bcb"
  integrity sha512-T72XyZ7UaHcbR+OuthTr8O9Vq2219sha5Jz1izIKkW3Jw2XyXR9gkX78lD/Am+LxZjZlyro1EiJRcTOdAhD5fQ==

Note: this worked the first run, failed in all subsequent runs. Note: re-installing the package did not help me.

KobyButler commented 1 year ago

I am having the same issue. It worked perfectly the first time, but it fails every time after. Anyone get a fix for this?

anjum121 commented 1 year ago

I was facing the same issue. with different versions for node, it didn't work as expected.

It's working only if I use below version

npm i -g @parvineyvazov/json-translator@1.6.4

davemoz commented 11 months ago

Same issue here. Switching to node v14.20.0 didn't work either. Had also tried v16.19.0 & lts(v18.16.1). None work.

ParvinEyvazov commented 11 months ago

Most probably it is happening because of the server limitations of Google and Bing. Because of that, it sometimes works, smth not.

For avoiding this, proxy list can be used (only valid for Google API now). I am investigating to solve this.

@davemoz @anjum121 @KobyButler

kracas commented 11 months ago

I'm getting the same error even with Libre or Argos. The first time it works, but then it starts spitting out this error. This happens on v1.7.0. If I try to downgrade, the error remains. On clean install of v1.6.4 everything works as expected.

Valen-H commented 10 months ago

I'm constantly getting this too

PeterWadie commented 10 months ago

I also have the same issue using version 1.7.0

ParvinEyvazov commented 10 months ago

New version of jsontt is out v1.8.0

There were some issues with the target and sources. All fixed now. Please try to use the other translation services if it is possible.

For Google API, I am trying to find a stable fix for it.

Binurim commented 8 months ago

Having the same issue using version 1.8.0

kurraz-soft commented 7 months ago

Same here, 1.9.0 using Google (node & cli)

But cli bing is fine.

UPD: No bing show same errors if json file is complex enough

ParvinEyvazov commented 7 months ago

I wil try to come up with some solutions for this problem soon.

ParvinEyvazov commented 7 months ago

Hello all, now jsontt have a feature that solves this problem.

If you enable fallback logic on CLI (-fb yes), it will try another possible translation service if the one fails.

Also, you can set the max concurrency limit from CLI (-cl 100), default is 3. Setting a concurrency limit lets you control the number of requests at the same time to prevent getting banned.

More info in Readme

mfalconi-perle commented 6 months ago

Hello all, now jsontt have a feature that solves this problem.

If you enable fallback logic on CLI (-fb yes), it will try another possible translation service if the one fails.

Also, you can set the max concurrency limit from CLI (-cl 100), default is 3. Setting a concurrency limit lets you control the number of requests at the same time to prevent getting banned.

More info in Readme

Is there a way to change these config when using in a node file and not on the CLI?

ParvinEyvazov commented 6 months ago

Hi @mfalconi-perle, there is no way for now. I am planning to add it. Thank you for suggestion.