PO/POT now contains substitution names. Why?

10 views
Skip to first unread message

Matt Documatt

unread,
Dec 3, 2021, 4:59:09 AM12/3/21
to sphinx...@googlegroups.com
Hi friends,
I've just updated from Sphinx 3.5.3 to 4.1.0. Now, "make gettext" extracts all substitution names. I can't find any details at https://www.sphinx-doc.org/en/master/changes.html.

For example, in RST:

.. |grid-manual-actions-action-trigger| image:: img/portlets/grid-manual-actions-action-trigger.nol10n.png

and in POT:

msgid "grid-manual-actions-action-trigger"
mststr ""

I'm sure that substitutions were not picked up MessageCatalogBuilder...

Is this behavior configurable and documented?

Thanks

Matt
https://techwriter.documatt.com


Pieter Claeys

unread,
Dec 16, 2021, 8:34:06 AM12/16/21
to sphinx-users
Hi, I also recently encountered this problem, yesterday.
I think it's caused by this feature introduced in 4.0:
I guess that an image without any 'alt text' uses the substitution reference. Which then ends up in the .po files

As a workaround, I have added an empty ':alt:'  option to each image directive in the rst file.  It's some work, but I found the strings are not longer present in the po/pot files.
Example

.. |grid-manual-actions-action-trigger| image:: some_image.png
   :alt:

One could debate if the current behavior is a defect  (from my point of view, I'd say that 
Reply all
Reply to author
Forward
0 new messages