mololab / json-translator

jsontt 💡 - FREE simple CLI to translate your json files into other languages ✅ Check Readme ✌

Home Page:https://mololab.org/jsontt/npm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error While Translating: Assigned "--"

psarno opened this issue · comments

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

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

commented

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

commented

same here, not working :(

which translation service are you using?
@jgrp-dev @TakiGuan @israel-kochava @psarno

commented

@ParvinEyvazov
I tried with Google & Bing.

@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.

commented

It is valid, now getting the same previous error.

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

@jgrp-dev can you please try the latest version which is 1.7.0

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.

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

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

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.

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

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.

I'm constantly getting this too

I also have the same issue using version 1.7.0

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.

Having the same issue using version 1.8.0

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

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

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

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?

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