json-autotranslate
json-autotranslate copied to clipboard
Feature suggestion: Translating updated strings again
Hello,
thanks for making this amazing script. It helps us greatly to save so much time translating at Tinkamo. I know this might be a big idea requiring more coding, but what do you think about the functionality of being able to detect whether a source string has changed and translating it again? What do you think about it? :)
Hey @petrchutny,
thanks for your feedback! It's awesome to see this tool being used in real-world products!
I'm guessing that you're using key-based translation, like:
{
"SOME_TEXT": "This is a string",
"OTHER_TEXT": "This is another string"
}
To be able to detect changes, json-autotranslate would need to keep a kind of cache folder containing the latest translated version of files and compare them to the current ones.
This feature has already kind of been requested in #5 and I will try to implement a good solution for it this week.
Thinking about it, keeping the last translated version would also allow json-autotranslate to detect which translations have been manually edited and warn the user if they would be overwritten by a command.
Thanks for your reply :) Yes, we’re using it for key-based translation. That’s great that you’re up for doing it! Your idea with the warnings is also very good.
All the best & thanks,
— Petr Chutný petrchutny.cz On 4 Nov 2019, 23:53 +0800, Leo Bernard [email protected], wrote:
Hey @petrchutny, thanks for your feedback! It's awesome to see this tool being used in real-world products! I'm guessing that you're using key-based translation, like: { "SOME_TEXT": "This is a string", "OTHER_TEXT": "This is another string" } To be able to detect changes, json-autotranslate would need to keep a kind of cache folder containing the latest translated version of files and compare them to the current ones. This feature has already kind of been requested in #5 and I will try to implement a good solution for it this week. Thinking about it, keeping the last translated version would also allow json-autotranslate to detect which translations have been manually edited and warn the user if they would be overwritten by a command. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
I've implemented this in v1.5.0, check it out if you like :)
So the cache folder should be kept as part of source control? I ignored it as I assumed it was temp folder, make sense now that I read this.
Ah, yes :)
Maybe calling it .json-autotranslate-cache was not the best idea. Do you have a better name in mind that would suggest it should be part of source control?
Hmm .json-autotranslate-history
For attranslate, I called it attranslate-cache instead of .json-autotranslate-cache.
Keeping this cache in source control is not strictly required, but highly recommended.
One thing that I am not yet sure about is the number of required caches.
For attranslate, once cache per source-file is sufficient.
However, in future versions of attranslate, this might be changed to "one cache per source-target combination".
In contrast, json-autotranslate keeps once cache for every file, which I am not sure why this was done.