novelWriter icon indicating copy to clipboard operation
novelWriter copied to clipboard

Multi language books

Open julichan opened this issue 1 year ago • 4 comments

Hello,

I think it would be great to have multi language support when you are writting a book in multiple languages. off course today, it s possible to run two instances of novel writter side by side for each translation but i think it'd be better handled by novel writter.

I think each language would be new files in the content folder and the structure might need either a root node per language containing all existing nodes or each node of the structure would simply reference a new file per languages. Two files could easily be put side by side just like we can see markdown on one side and the rendered documents today but we would choose either markdown or wisiwig editors and the language on each side while we write the translation.

I can polish my idea but what do you think of this ?

julichan avatar May 14 '24 18:05 julichan

It's been discussed a bit before, like for instance here: https://github.com/vkbo/novelWriter/issues/1541#issuecomment-1898768397

I'm positive to this. Due to the way the spell checker in handled (third party library), which takes a single dictionary, it would not be trivial to spell check multiple languages. The third party library uses some singleton setup that may require internal reloads for changing language.

However, marking certain regions or entire documents as a different language and have the spell checker ignore them of the language doesn't match, wouldn't be too difficult. The spell check language can easily be switched from the Tools menu now, so a first iteration like this isn't too difficult to implement. It would also be easy enough to handle on export to ODT format where multiple spell checkers are available.

vkbo avatar May 14 '24 18:05 vkbo

Marking certain regions as non translatable at all would be good too. Tolkien created his own language and that wouldn't quite work with a spell checker i guess.

julichan avatar May 14 '24 19:05 julichan

With the [lang:<code>] syntax proposed you can just set the <code> to something that isn't valid, like none, and it should ignore it. It would only activate spell checking if the code matches the spell checked language.

vkbo avatar May 14 '24 19:05 vkbo

By the way, with ODT, the language code for "no language" is "zxx" and the country code is "none". The combined locale code would therefore be "zxx-none" instead of "en-US", for example.

See also ISO 639, where "zxx" is for "No linguistic information at all".

peter88213 avatar May 16 '24 19:05 peter88213