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

Feature suggestion: Translating updated strings again #8

Open
petrchutny opened this issue Oct 30, 2019 · 7 comments
Open

Feature suggestion: Translating updated strings again #8

petrchutny opened this issue Oct 30, 2019 · 7 comments
Assignees

Comments

@petrchutny
Copy link

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? :)

@leolabs
Copy link
Owner

leolabs commented Nov 4, 2019

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.

@leolabs leolabs self-assigned this Nov 4, 2019
@petrchutny
Copy link
Author

petrchutny commented Nov 7, 2019 via email

@leolabs
Copy link
Owner

leolabs commented Nov 8, 2019

I've implemented this in v1.5.0, check it out if you like :)

@cs-NET
Copy link

cs-NET commented Nov 19, 2019

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.

@leolabs
Copy link
Owner

leolabs commented Nov 20, 2019

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?

@cs-NET
Copy link

cs-NET commented Nov 22, 2019

Hmm .json-autotranslate-history

@fkirc
Copy link
Contributor

fkirc commented Nov 1, 2020

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.

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

4 participants