I'm currently working on that and I want to share a few things asking for your opinions.
Format: The only import format will be DOCX. I think it's better to have one format that works well than multiple with less functionality. DOCX is a common format. Most current word processing applications I know include an export function into this format.
Algorithms: I'm implementing 3 – 4 general import algorithms (with a little fine-tuning I don't mention here):
Create heading levels from font sizes and match them with the headings of the original. (E.g. font sizes in the import: 20 pt, 15 pt, 10 pt. Headings in the original: h1, h3. Match: a 20 pt heading will be at the position where the h1 heading is, a 15 pt heading where the h3 heading is.)
Use 25% of the biggest font sizes as headings, every of those font sizes matches any heading.
Use paragraphs without period at the end and which are shorter than 200 characters as headings.
Don't try to match any headings.
Empty paragraphs: What to do with them? My plan was to at first keep them and delete them only if the number of paragraphs of a chapter exceeds those of the original. This way they would be a placeholder for not translated paragraphs. But my brother didn't like that idea. It wasn't consistent nor obvious. He would delete all empty paragraphs at the beginning of the import process.
Styling: I'm implementing to import bold, italic and underline. Footnotes will be part of another release, I think.
Parts: Where to have the import buttons?
For the whole document.
For each chapter?
At each paragraph that the translator has the option to import from that paragraph on? Maybe he translated a few (maybe 50) paragraphs only.
I'm currently working on that and I want to share a few things asking for your opinions.