Discussion:
[Docutils-users] how to correct reStructuredText markup in batch.
Jeffery
2016-05-30 14:49:37 UTC
Permalink
hello,,


recently i review the translation project that translate English reST
document into chinese reST document use gettext tools on transifex
platform.

a you know, there have no bank need in chinese, and most translator no
sense with reST markup, so that the no bank around reST markup. now, i
want a tools/or scripts that can correct this issue batch process po file.

thanks.
--
Jeffery -odoo expert form kunshan, suzhou, china
Guenter Milde
2016-05-30 17:01:08 UTC
Permalink
[-- Type: text/plain, Encoding: --]
hello,,
recently i review the translation project that translate English reST
document into chinese reST document use gettext tools on transifex
platform.
a you know, there have no bank need in chinese, and most translator no
sense with reST markup, so that the no bank around reST markup.
I suppose you mean blank (or whitespace), do you?
now, i want a tools/or scripts that can correct this issue batch
process po file.
I don't know of any such ready-made tool.

I see two possible ways:

a) Use a text editor or script language and regular expressions to convert
e.g. "a*" to "a\ *" and "*a" to "*\ a" (a stands for any chinese letter
around the inline markup).

b) Download a daily snapshot of Docutils from the SVN repository
(http://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/)

In the configuration file
set the new setting "character-level-inline-markup: True"
or use the command line option ``--character-level-inline-markup``
(see the SVN version of docutils/docs/user/cofig.txt).

Of course, this only works if you can install this version at the
target system.

Hope this helps

Günter

Loading...