Hi everyone,

I have some documentation in sphinx/rst format (https://doc.wapt.fr/) that was initially written in French and that we translated to English latter on.

I would like to change the source language to English and French be just one traduction among others.

Switching source file language in the po files is easy, but I have not found any easy way to swap French text with its English translation in the rst files.

One of the nice thing would be to use Sphinx AST, do the string swap in the tree, but there is no RST output for sphinx builder, so I cannot go back to rst from there.

There are some scripts in docutils like rst2xml.py that allow one to have an xml tree to manipulate, which could be fine. However the xml2rst script from docutils sandbox does not work out of the box (and it is based on xslt transformation, so I wouldn't dare to look at its guts), and rst2xml has some Sphinx syntax it does not understand.

So I started to write some down to earth sloppy script based on polib and regexp, but I am no regexp expert and sometime regexp seem to have a life on their own, and not do what you were expecting them to do...

Does anyone on the list had to do the same thing? If yes, what did you use, do you have some hints/scripts samples/etc ?

Cheers,

Denis

--
Denis Cardon
Tranquil IT Systems
Les Espaces Jules Verne, bâtiment A
12 avenue Jules Verne
44230 Saint Sébastien sur Loire
tel : +33 (0) 2.40.97.57.55
http://www.tranquil.it

Samba install wiki for Frenchies : https://dev.tranquil.it
WAPT, software deployment made easy : https://wapt.fr

--
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to