optuna/doc-optuna-zh-cn

Translation of note

chenghuzi opened this issue · 0 comments

We have Paragraph-level markup note in some generated files (gitignored). If you clone the project and compile it, source/locale/zh_CN/LC_MESSAGES/reference/generated will appear. In a file called optuna.create_study.po we have some lines like this:

msgid ""
"Database URL. If this argument is set to None, in-memory storage is used,"
" and the :class:`~optuna.study.Study` will not be persistent.  .. note::"
"     When a database URL is passed, Optuna internally uses `SQLAlchemy`_ "
"to handle     the database. Please refer to `SQLAlchemy's document`_ for "
"further details.     If you want to specify non-default options to "
"`SQLAlchemy Engine`_, you can     instantiate "
":class:`~optuna.storages.RDBStorage` with your desired options and     "
"pass it to the ``storage`` argument instead of a URL.   .. _SQLAlchemy: "
"https://www.sqlalchemy.org/  .. _SQLAlchemy's document:      "
"https://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls  .."
" _SQLAlchemy Engine: "
"https://docs.sqlalchemy.org/en/latest/core/engines.html"

the .. note::" above represents notes directive. Here is the rendered output:

image

But it seems that this block cannot be changed with even slight modifications. For example, if we replace URL with U RL like this:

msgstr ""
"Database U RL. If this argument is set to None, in-memory storage is used,"
" and the :class:`~optuna.study.Study` will not be persistent.  .. note::"
"     When a database URL is passed, Optuna internally uses `SQLAlchemy`_ "
"to handle     the database. Please refer to `SQLAlchemy's document`_ for "
"further details.     If you want to specify non-default options to "
"`SQLAlchemy Engine`_, you can     instantiate "
":class:`~optuna.storages.RDBStorage` with your desired options and     "
"pass it to the ``storage`` argument instead of a URL.   .. _SQLAlchemy: "
"https://www.sqlalchemy.org/  .. _SQLAlchemy's document:      "
"https://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls  .."
" _SQLAlchemy Engine: "
"https://docs.sqlalchemy.org/en/latest/core/engines.html"

the output will crash:

image

This was not a problem when the doc is not generated automatically. You can find .. note:: in some deprecated translations:

#~ "will not be persistent. .. note::"

I guess probably this is due to the auto-generation mechanism and strict punctuation requirement of Sphinx note. Even changing URL to U L will lead to crashed output. Currently I haven't found a good solution for this problem.