Toctree text not being translated

32 views
Skip to first unread message

Joe Landers

unread,
Feb 26, 2018, 6:51:55 PM2/26/18
to sphinx-users
Hi, I see what looks to be support for this in the code here, but I'm unable to get it to work.

More concretely, if I have a .rst file like this:
.. toctree::
   :maxdepth: 2
   :caption: Contents:

    Explicit Title <some_doc>
    External Link <https://google.com>

I want "Contents:", "Explicit Title", and "External Link" to be extracted into a .pot file, (and later to be replaced by the translated strings in a .po file), but this isn't happening.

It looks like there's code to do this, so maybe I'm doing something wrong.

Thanks for the help!
-Joe

Komiya Takeshi

unread,
Feb 26, 2018, 8:30:00 PM2/26/18
to sphinx...@googlegroups.com
Hi,

On my local, "Contents:" are extracted into .pot file. Certainly
others are not. At present, they are not supported.
Please file a issue. I will work it future.

Thanks,
Takeshi KOMIYA
> --
> 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 post to this group, send email to sphinx...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sphinx-users.
> For more options, visit https://groups.google.com/d/optout.

Joe Landers

unread,
Feb 28, 2018, 3:25:01 AM2/28/18
to sphinx-users
Ah, yes, you're right about "Contents:", my mistake.

I will open an issue on Github.

Thanks!

Libor Jelínek

unread,
Nov 20, 2019, 10:08:11 AM11/20/19
to sphinx-users
Let me to follup up. I have the same question - how to localize toctree :caption: and body. However, in my case even captions are not extracted into POTs.

Original thread is 2 years old. Maybe version existing at that time did it correctly. Now i'm using latest 2.2.1 and :caption: are not extracted into POTs. Can somebody to retest extracting :caption:?

For the rest - extracting explicit titles and explicit link titles - was the bug really filed?

L.


Dne úterý 27. února 2018 2:30:00 UTC+1 Komiya Takeshi napsal(a):

Komiya Takeshi

unread,
Nov 20, 2019, 10:22:20 AM11/20/19
to sphinx...@googlegroups.com
Hi,

On my local, captions of toctree title are extract to pot files. If
not, please file a new issue to the list. It would be nice if you have
minimal reproducible example. I'll take a look later.

About explicit titles, I just implement it in this week. It will be
shipped as 2.3.0 soon.
https://github.com/sphinx-doc/sphinx/pull/6784

Thanks,
Takeshi KOMIYA

2019年11月21日(木) 0:08 Libor Jelínek <ljel...@virtage.com>:
> 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/cc40a367-8691-48b8-af78-ff262ed11543%40googlegroups.com.

Libor Jelinek

unread,
Nov 21, 2019, 4:31:04 AM11/21/19
to sphinx...@googlegroups.com
My stupid mistake - I had latest Sphinx in requirements.txt but forgot re-create venv and using prehistoric version from it. --> I confirm that toctree's captions are correctly extracted to POTs.

More translatable doctrees - amazing work as always, Takeshi. Thank you for greating Sphinx great!

Libor


st 20. 11. 2019 v 16:22 odesílatel Komiya Takeshi <i.tk...@gmail.com> napsal:
Reply all
Reply to author
Forward
0 new messages