go-json-translate icon indicating copy to clipboard operation
go-json-translate copied to clipboard

Populate DB with strings translated in the past

Open pdrhlik opened this issue 1 year ago • 6 comments

Imagine I have a source English translation in a file en.json. I have translations of this file in a few more languages like cs.json, de.json etc. I would only like to translate the newly added strings in en.json but not the old ones because they were already translated in the past.

This could be solved by saving translations from cs.json etc to the translator.db database. Only the new keys would then be translated using Deepl API.

pdrhlik avatar Aug 30 '23 12:08 pdrhlik

This is the current behavior, or I'm not understanding correctly what you're saying

gmonarque avatar Aug 30 '23 17:08 gmonarque

I'll try again. It's ok when I want to translate a new language completely. But right now I have a project that contains multiple translation files translated by a community. If I use your program now, all strings would get translated again which I don't need.

Let's say I have two files, en.json and cs.json. I haven't used your program yet so the translator.db doesn't contain the translations yet.

If I want to translate en.json to Czech, all the strings will be translated through Deepl API. But I don't need that because I already have the Czech translations from a different source. What I would like to do is to only translate newly added strings from now on.

Is that more clear?

pdrhlik avatar Aug 30 '23 17:08 pdrhlik

Yes I understand now, you want to populate the database with the content of cs.json. It looks like an edge feature to me, but it's simple to implement. Are you in immediate need of such a feature?

gmonarque avatar Aug 30 '23 17:08 gmonarque

Exactly. I think it's actually a pretty important feature for people with existing projects. If you're starting from scratch, then it's obviously not necessary. Well time is relative, I'm not really in a hurry :-)

It will surely be useful in the future though. Everything else seems to be working pretty well and I'm thinking about integrating your tool more closely with my development flow.

Thanks!

pdrhlik avatar Aug 30 '23 18:08 pdrhlik

Well, that's a good reason for me to dust up this project. Please look forward for upcoming releases

gmonarque avatar Aug 30 '23 18:08 gmonarque

Great, thanks a lot!

pdrhlik avatar Aug 30 '23 18:08 pdrhlik