difftranslationdiff3

Maintain wiki translation


I'm trying to maintain several translations of a project on a wiki. The wiki doesn't support translation, but I can import/export using text files. So for simplicity's sake, let's consider every file in the documentation is a simple text file.

It goes like this:

  1. I write the wiki document in English.
  2. I download it (a tool does that for me, hopefully).
  3. The new file is copied in directories for other translations (it's new, so it's not translated yet).
  4. The translator translates the new wiki page in his/her own language. It's still on disk by that time, still in a txt file.
  5. Optionally, the translator uploads the newly translated file on the web.

So far, so good.

  1. I have developed a new feature and modified the English wiki page.
  2. I download it.
  3. I update the translated version... wait, it already exist, I can't just write the file to delete everything the translator did at step 4!

So I would like to have a way to create a partly translated file that will take into account:

  1. The file (in English) of the document when it was translated.
  2. The file (in whatever language) of the same file at the same moment.
  3. My newly modified file (in English).

It looks like a good use case for diff3. But diff3 doesn't really fancy working on files that have changed that much. True, both English versions can be compared, but the translated version is too much different, and conflicts are generated everywhere.

My approach to translation may be a bit strange, I've tried to find other strategies, but it has been drown in commercial alternatives, which are obviously not my first choice if I can help it.

I hope my explanations were helpful. Don't hesitate if I can specify a bit more.


Solution

  • So the answer, as far as I'm concerned, is to use a CVS like Git, with different translations on various branches.

    I put the English files on a branch, the French-translation on a different one... with my tools to export the Wiki content, it goes smoothly. The next step, when the English version is updated, is simple: commit and merge into the French-version. If Git knows its job (and it often does), it will create a new version of the file with conflicts. The translator has to solve them, commit (and for me, upload the translation). And voila. Next update, next merge, next conflicts, next upload. I've been doing that for a few updates and it seems to work fine. When Git doesn't really know what has been changed, it just selects more lines to make sure. And sometimes it fails but, hey, that's why we're there.