rst syntax parsing in languages not using spaces (eg. japanese, korean)

14 views
Skip to first unread message

Pieter Claeys

unread,
Oct 1, 2020, 10:46:48 AM10/1/20
to sphinx-users
I use a translation office to translate, using the .po workflow.
For Japanese and Korean, there are no spaces between words (I just learned this today - I don't know these languages). 
However, for a bold or italic (and other syntax), the sphinx rst parser expects a space before and after a **part of phrase in bold**.  (some other non-letter characters like . and : also close the syntax).

So, when I build Japanse or Korean, I got large amounts of warnings related to not closing the rst syntax.
(WARNING: Inline strong start-string without end-string.)

I can work around this by adding spaces. This solves the rst syntax problem, but the spaces are also rendered in the final result - which is understandable, but not perfect.
(... and unfortunately Japanese people are striving for perfection :-))

Any other ways to solve this ?  (I am using Sphinx 2.3.1, still - haven't upgraded yet)

Komiya Takeshi

unread,
Oct 1, 2020, 10:59:29 AM10/1/20
to sphinx...@googlegroups.com
Hi,

I usually use a technique that inserts an escaped space before and
after the decorated word.
For example, you can emphasize a word\ *like this*\ using escaped spaces.
It allows you to decorate without spaces. I know this is annoying. But
it helps us.

BTW, trimblank extension might help you. It removes spaces around
inline-markups. AFAIK, some Japanese users use it.
https://pypi.org/project/sphinxcontrib-trimblank/

Thanks,
Takeshi KOMIYA

2020年10月1日(木) 23:47 Pieter Claeys <pi3...@gmail.com>:
> --
> 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 sphinx-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/797d5fa3-6a56-4950-a280-8a644f1a1b9cn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages