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

Any way to ignore interpolated values

julianpoy opened this issue Β· comments

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

Hi, thank you for your comment.

It would be a great feature to handle these situations. I will try to add it asap πŸ‘.

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}}"
}

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

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

Thank you! amazing tool!

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

I will try to add this feature asap πŸš€

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.

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

You're the best, @ParvinEyvazov! Thank you for this great tool πŸ™‡β€β™‚οΈ