mololab / json-translator

jsontt 💡 - AI JSON Translator with GPT + other FREE translation modules to translate your json/yaml files into other languages ✅ Check Readme ✌ Supports GPT / DeepL / Google / Bing / Libre / Argos
https://mololab.org/jsontt/npm
MIT License
465 stars 60 forks source link

Execute script without --name #54

Closed mostafakarim closed 5 months ago

mostafakarim commented 5 months ago

Hello,

I want to use the following script in my CI/CD and not use suffix in my file names : jsontt ./locales/en.json --module google2 --from en --to ar fr es de it ru --fallback yes --concurrencylimit 10

but the prompt ask for the filename so the script won't continue without validate manually, and empty value doesn't work.

How can I execute this script without filename validation please ?

Thank you.

ParvinEyvazov commented 5 months ago

Hi @mostafakarim ,

Normally jsontt usage isn`t intended to be used on CI/CD. But that is a great use case and yes it has this kind of issue for this use case.

I am working on it and will publish a new version soon.

@dvdcpp

ParvinEyvazov commented 5 months ago

@mostafakarim @dvdcpp

It is fixed on jsontt v2.2.3.

jsontt ./locales/en.json --module google2 --from en --to ar fr es de it ru --fallback yes --concurrencylimit 10 --name ""

will set the name to an empty string, which will not add any suffix.

mostafakarim commented 5 months ago

Thank you so much for this quick fix ! 🙏

mostafakarim commented 5 months ago

@ParvinEyvazov I have this error when I try to update de module code EJSONPARSE npm ERR! path /Users/.../package.json npm ERR! JSON.parse Expected double-quoted property name in JSON at position 211 (line 10 column 5) while parsing '{ npm ERR! JSON.parse "name": "nuxt-app", npm ERR! JSON.parse "private": tru' npm ERR! JSON.parse Failed to parse JSON data. npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript.

Edit: @ParvinEyvazov indeed, it was from me, sorry for the disturbing :(

ParvinEyvazov commented 5 months ago

@mostafakarim Never saw it. There is some mess on the quotation symbols I guess. And I don't think this is something from jsontt.

dvdcpp commented 5 months ago

Works well thank you! It would be cool to also allow '' so if used in the package.json script the syntax is cleaner, but for now it also works like this:

  "scripts": {
    "translate": "jsontt src/translations/en.json --module google2 --from en --to it --fallback yes --concurrencylimit 3 --name \"\""
  },
ParvinEyvazov commented 5 months ago

yw! @dvdcpp

This syntax is also works fine: jsontt en.json --module google2 --from en --to ar fr --fallback yes --concurrencylimit 10 --name ''