Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command to change a key #5

Closed
djensen47 opened this issue Jun 30, 2019 · 6 comments
Closed

Add command to change a key #5

djensen47 opened this issue Jun 30, 2019 · 6 comments

Comments

@djensen47
Copy link

Every so often I need to change the value of a key. Usually it's a better message or I need to completely change a label. Right now, if I make a change I update the English translation file then delete that key from 14 other language files. It's a bit tedious.

Would would be nice is the ability to re-translate just one key.

I don't want to regenerate all the translation files because I've made some manual changes and don't want to lose them.

Thanks for making this great tool!

@leolabs
Copy link
Owner

leolabs commented Jun 30, 2019

Hey @djensen47,
would the -d or --delete-unused-strings flag do what you need? It deletes all translations that don't exist in the source language anymore.

@djensen47
Copy link
Author

So I would do the following?

  1. Delete the key from the source file
  2. Run json-autotranslate with -d
  3. Add the key back with a new value
  4. Run json-autotranslate again

@leolabs
Copy link
Owner

leolabs commented Jun 30, 2019

You can combine steps 1 and 3, so you just

  1. Delete the old key and add the new one
  2. Run json-autotranslate with the -d flag

This will translate the new key and delete the old one from translated files :)

@djensen47
Copy link
Author

I wouldn't be able to do that since it's the same key. I'm updating the value.

For instance, I'm doing something like this:

{ "welcome": "Welcome!" }
{ "welcome": "Welcome to our app!" }

@leolabs
Copy link
Owner

leolabs commented Jun 30, 2019

Ah, I was assuming you were using a Natural Language format. In your case, the process you described would do the job.

@leolabs
Copy link
Owner

leolabs commented Jul 8, 2019

I'll close this ticket for now. If you have any further questions, feel free to re-open it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants