Groups
Groups
Sign in
Groups
Groups
sphinx-users
Conversations
About
Send feedback
Help
how to translate strings in conf.py?
12 views
Skip to first unread message
RJ Skerry-Ryan
unread,
Feb 21, 2020, 1:06:43 PM
2/21/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sphinx-users
There are various user-visible strings in conf.py that I'm not sure how to translate, for example copyright, html_title, etc.
https://github.com/mixxxdj/manual/blob/1dcda2ff0f8dabf252eff5fecfb936a67f1d4380/source/conf.py#L54
Is there a way to translate these? I've tried:
from sphinx import locale
copyright = _("...")
But they do not show up in source/locale/*.pot after running make gettext.
Komiya Takeshi
unread,
Feb 21, 2020, 10:44:02 PM
2/21/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sphinx...@googlegroups.com
Hi,
Hmm... it's difficult question. At this moment, there are no support
from Sphinx.
So you need to switch messages inside conf.py by yourself:
```
if language == 'ja':
copyright = ...
elif language == 'de':
copyright = ...
else:
copyright = ...
```
Thanks,
Takeshi KOMIYA
2020年2月22日(土) 3:06 RJ Skerry-Ryan <
russel...@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/dcf7448a-7b4b-44a7-903b-6c726e404431%40googlegroups.com
.
Reply all
Reply to author
Forward
0 new messages