Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.83k stars 321 forks source link

Interface language files with modified text support #2209

Open Beep6581 opened 9 years ago

Beep6581 commented 9 years ago

Originally reported on Google Code with ID 2225

I planned to implement a way to have language files which would support letting the
translator know when an already translated text is outdated because the original English
one in "default" changed. I wanted to do this in Bash, but of course that limits us
to Bash users. Better to do it in something cross-platform like Python, but I don't
know that yet.

It would work like this:
All language files would look like this:
KEY:checksum;Human text
After adding text or making changes to "default", the script would be run, which will
update the checksum for each "Human text".
The script would also copy these checksums into the translation files.
e.g. the checksum stored for each key in Espanol would correspond to the one in "default"
at the time of translation.
Now if I want to translate Espanol a month from now, I run the script again, and the
script generates new checksums for each key in "default" and matches them against those
already stored in Espanol. If they match, we know the "default" text did not change.
If they do not match, we know the "default" text changed, and even if there already
is a Spanish translation of that key, we know it's outdated and must be revised.
Even though the text changed, it's likely the old translation is still better than
none, so instead of prepending an exclamation mark to the changed line, the script
could figure out some other way of letting the user know of the change while at the
same time letting RawTherapee still use that line, e.g. instead of prepending "!" it
could prepend "?", or maybe just moving it into the front of the translation file between
some "# CHANGED KEYS FOLLOW" section.

Reported by entertheyoni on 2014-01-28 07:01:57

Beep6581 commented 9 years ago
Thanks a lot for trying to fix this real problem. Your suggestion is interesting, however
it would be up to the translator to update the checksum as soon as the key has been
translated/updated. Moreover, not all devs can/will run the script to update the checksum,
I'm pretty sure of that.

Maybe something simpler could be done without adding tons of checksum through Mercurial?
It's the way I'm using actually: I'm asking the history of the "default" file then
update all strings that have been changed since the last update of the translation
file.

Maybe it would be simpler to investigate on Mercurial's possibilities, e.g. asking
to compare the current version of "default" to the one of a specific date. Not sure
it can be easily done :-/

Reported by natureh.510 on 2014-01-30 20:28:38

Beep6581 commented 9 years ago
"it would be up to the translator to update the checksum as soon as the key has been
translated/updated"
Actually nothing would change, because I still run generateTranslationDiffs on every
user-submitted translation before committing it, and that would update the checksums.

"not all devs can/will run the script to update the checksum, I'm pretty sure of that"
Yes that is a problem with the current script too - Bash.

Using mercurial is also not optimal because, well, you'd have to use mercurial :] That
means learning it, and also means cloning. I've had complaints from package managers
(those people who make RT available on various distributions), which is why since 4.0.9
I started including source tarballs, so they can ship RT without having to use mercurial
and without having to clone. I guess translators wouldn't like this either.

Oscar is working on a javascript interface to handle translations. We're discussing
all of this via email, including the handling of modified source text. That should
be good - no installation, cross-platform. Not sure if it will make generateTranslationDiffs
completely obsolete, but it will diminish the need for using it and make translation
easier.

Reported by entertheyoni on 2014-01-31 08:15:09