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
452 stars 57 forks source link

Any way to ignore interpolated values #5

Closed julianpoy closed 1 year ago

julianpoy commented 2 years ago

Hey there!

I use ngx-translate to represent translations and was wondering if there was a way to ignore interpolated values.

For example:

{
   "app.welcome": "Welcome {{name}}",
}

Right now it translates both "Welcome" and "name" to the target language. The goal would be for it to only translate "welcome".

ParvinEyvazov commented 2 years ago

Hi, thank you for your comment.

It would be a great feature to handle these situations. I will try to add it asap 👍.

ParvinEyvazov commented 1 year ago

Hi @julianpoy

With v1.1.0 it ignores the values in translation that are in double curly braces. 🥳

Use {{word}} style on your object as you mentioned above.

Example:

{
  "one": "Welcome {{name}}"
}

...translating to spanish

{
  "one": "Bienvenido {{name}}"
}
julianpoy commented 1 year ago

@ParvinEyvazov This is awesome! Thank you very much for implementing this change. Will try this package out now!

daniel-farina commented 1 year ago

@ParvinEyvazov In react they use <{value} instead of. {}., could you add support for this?

Thank you! amazing tool!

ParvinEyvazov commented 1 year ago

Hi @daniel-farina, Thank you for your great suggestion.

I will try to add this feature asap 🚀

daniel-farina commented 1 year ago

Hi @daniel-farina, Thank you for your great suggestion.

I will try to add this feature asap 🚀

Correction above, not <{} but just single {}

Tysm! As soon as it's done I'll add it to some docs for people to use it to help translate our app.

ParvinEyvazov commented 1 year ago

Hey @daniel-farina & @trevorblades 🙋‍♂️

I have great news!

Now you can use {word} syntax to ignore unwanted translations with version 1.4.0. 🎉

{{word}} syntax is still available too

trevorblades commented 1 year ago

You're the best, @ParvinEyvazov! Thank you for this great tool 🙇‍♂️