Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation of note #4

Open
chenghuzi opened this issue Feb 10, 2021 · 0 comments
Open

Translation of note #4

chenghuzi opened this issue Feb 10, 2021 · 0 comments

Comments

@chenghuzi
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant