You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a POT file with a message that contains a %, sphinx-intl update will produce a PO file where that message has an added #, python-format flag. That flag indicates that the message is a python format string, but all sphinx-intl messages should come from RST.
Example POT file:
# pot_dir/test.pot
msgid ""
msgstr ""
msgid "the % of change in sediment"
msgstr ""
Produces this PO file:
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-12-06 15:01-0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
#, python-format
msgid "the % of change in sediment"
msgstr ""
The text was updated successfully, but these errors were encountered:
It seems babel library adds the "python-format" flag when reading the message catalog from a pot file. I'm not sure what is happened inside babel...
$ python
Python 3.7.12 (default, Oct 5 2021, 14:06:57)
[Clang 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from babel.messages.pofile import read_po
>>> catalog = read_po(open('test.pot'))
>>> list(catalog)
[<Message '' (flags: [])>, <Message 'the % of change in sediment' (flags: ['python-format'])>]
It looks like this is a longstanding issue with babel: python-babel/babel#35 that might not get solved anytime soon. In the meantime, would it make sense for sphinx-intl to filter out all python-format flags?
Given a POT file with a message that contains a
%
,sphinx-intl update
will produce a PO file where that message has an added#, python-format
flag. That flag indicates that the message is a python format string, but allsphinx-intl
messages should come from RST.Example POT file:
Produces this PO file:
The text was updated successfully, but these errors were encountered: