0

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.

vincent-lg
  • 539
  • 7
  • 15
  • You need a version control system for this! Borderline similar question answered [here](http://stackoverflow.com/a/38413179/23118). – hlovdal Oct 04 '16 at 20:49
  • I hadn't thought about that solution, though I use a CVS for about anything nowadays. I've tried to apply this strategy, but I'm not sure it works well: – vincent-lg Oct 04 '16 at 22:15
  • $ mkdir doc $ cd doc – vincent-lg Oct 04 '16 at 22:19
  • Okay, seems I can't leave comments with new lines, and I can't answer to my own question. I tried to use Git to do the trick, with one branch to store English version and a second to store French. But 'git format-patch fr..en' does show changes in the English version, but they need to be applied manually. – vincent-lg Oct 04 '16 at 22:24
  • Okay, I was looking for a tricky way... and merging branch is a pretty simple solution. I guess it does perform a diff3 at some level. Anyway, I have the English version on a branch, the French one on another, and I just need to merge on into the other to update... and fix conflicts! – vincent-lg Oct 18 '16 at 03:41

1 Answers1

1

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.

vincent-lg
  • 539
  • 7
  • 15