Advice for writing a book in two languages simultaneously?

I have a use case that seems to be a little bit different from what I’ve been able to find elsewhere: I want to write a book in two languages, more or less simultaneously (English and Khmer). I’m generally aware of CAT software that has the concept of an “original file” and “target file”, but the software I’ve seen seems to assume that there is an “original file” that doesn’t change, and you just work off of that throughout the translation process.

The problem is, I’m expecting to edit both the “original” (English) and “target” (Khmer) files throughout the course of the project, and want to manage that process without it getting too crazy. For example, if after translating much of the text from English into Khmer, I expect to frequently go back and change the English, and need to know where those changes happened so I can later go back and change the Khmer. Or alternatively, make changes to the Khmer translation, and not necessarily have time in the moment to translate changes back to the English every time, in which cases the two get out of sync.

I’ve also seen software which helps with writing books, such as the longform plugin for Obsidian, or specialized software such as Scrivener. However, this doesn’t help manage the two translations.

Any suggestions on how to manage two files/documents (or could be multiple files for all I care) to keep them in sync? I’m actively using Obsidian but open to non-Obsidian solutions as well

If I were doing this, my non-tech solution would be to assign each sentence an ID number. That way, if I make a change in one language, I can quickly find the corresponding sentence to change in the other. Like chapter and verse in the Bible. This is what I do for translation work.

I don’t know. You could halve a page’s* worth of material with --- and do work on upper and lower parts (you could use %%'s to make remarks for improvement or non-publishable asides for yourself) and when all your work is done, you could use those three dashes as an anchor to separate your English and Khmer parts (search and replace with regex and concatenate the parts afterwards).

You could start off like this until a more elegant programmatic solution presents itself. As for other software, well, for me, it’s important to stick to one writing app because once I put in the time to set up my text replacements (cross-platform as well), and other goodies (buttons, icons, etc.), I’m not going to give it up. But one is always forced to give up something here in order to gain something there.

* A page can be any length in Obsidian, of course. You can go by subchapters or whatever. The smaller the page, the better able you are to navigate yourself on it.

I mostly put my two cents in here only because there may come a time when I need to work out a solution myself, although I may never get around to providing English translations for my work. My number one concern is my own nation. The Anglo-Saxon world is too self-assured to care anyway and is bent on destroying itself (and now wants us little people to pay for their wars).

I’d write notes to myself when I change something in one and not yet the other. For notes like that I ==highlight== the text the note applies to and put a %%comment%% (or more widely compatibly, a <!--comment-->) immediately after (==highlight==%%comment%%). I have a (not totally elegant) way to list all the highlights.

I know of another person who uses task lists for their writing notes.

- [ ] like this

Thanks this is helpful for getting some brainstorming going – maybe using the markdown comment syntax plus a way to track changes as well as support for syncing the scrolling between two files (as this post requests) would be sufficient…though neither of these looks supported yet.

I used to do something similar in latex. First I wrote the entire text in my mother language using latex. After, I commented each paragraph in my mother language and right after each line of text added the translation. it is important to maintain one phrase per line, as latex allows to create a new paragraph with two line breaks, so one line break does not affect the final generated text.

The final text had the following format:
%text in my mother language
translated text
%text in my mother language
translated text

For more than two languages you may need some internationalization software, I don’t know about it but I suppose there are tools for this purpose.

1 Like

This is how Markdown works, too. Obsidian behaves differently because many people find that behavior surprising, but you can enable it by turning on Settings > Editor > Strict line breaks.

1 Like

I’m not sure how easy it would be to keep track, but could it be an option to have one language as normal text, and the other one as quoted text, and then have some CSS classes to hide/show the variants?

This would allow for both versions in the same document, and since I’m assuming you know both languages, it would be somewhat easy to see where to translate when there is a mismatch between the texts.

Another option, which could be useful in either case is to submit all of your text to git version control (this also applies if having multiple files). If you then write a lot in either language, you could could track the changes using some of the git tools, and then make sure you’ve translated the changes accordingly. When the changes have been translated, you could submit those changes, and move forward to the next set of changes.

I use a similar approach when documenting code, where I code stuff, and then use the git log to check what I changed recently, and then as I go through the git log I can verify that I’ve updated the documentation accordingly.