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
and do some processing on my translation (PO, POT) files, and output the result using:
c.dump_po(self.opo_path, msg_data)
the routine creating Message in
babel/messages/catalog.py
is called to create a new Message and it's wrongly guess the 'python_format' for messages containing '%' in the id's body. The use of '%' DOESN'T ALWAYS signify the '%s' etc.. Many times it's used to signify percentages, as in '%20', for example. This caused the 'poedit' editor to fail the validation (CORRECTLY so) for the message.
I haven't debug to find out where the
self.python_format
in the init method of the Messsage is switched to True yet, but this is definitely wrong.
How to Reproduce
$ git clone https://github.com/.../some_project
$ cd some_project
$ pip install -r requirements.txt
$ cd docs
$ make html SPHINXOPTS="-D language=de"
$ # open _build/html/index and see bla bla
Create a po file with a message that uses '%' as percentage in it, such as:
msgid "Build proxy resolution 100% of the original footage dimension"
msgstr ""
then use:
import os
from sphinx_intl import catalog as c
home = os.environ['HOME']
in_po_path = os.path.join(home, 'test_file.po')
out_po_path = os.path.join(home, 'test_out_file.po'
msg_data = c.load_po(in_po_path)
c.dump_po(out_po_path, msg_data)
You shall see the output entry above containing a python-format flag:
#, python-format
msgid "Build proxy resolution 100% of the original footage dimension"
msgstr ""
Expected behavior
Only insert 'python-format' for '%s' or '%d' (as a space holder for the variables)
Describe the bug
I am using version 3.5.4. I often use
from sphinx_intl import catalog as c
then use:
msg_data = c.load_po(self.po_path)
and do some processing on my translation (PO, POT) files, and output the result using:
c.dump_po(self.opo_path, msg_data)
the routine creating Message in
babel/messages/catalog.py
is called to create a new Message and it's wrongly guess the 'python_format' for messages containing '%' in the id's body. The use of '%' DOESN'T ALWAYS signify the '%s' etc.. Many times it's used to signify percentages, as in '%20', for example. This caused the 'poedit' editor to fail the validation (CORRECTLY so) for the message.
I haven't debug to find out where the
self.python_format
in the init method of the Messsage is switched to True yet, but this is definitely wrong.
How to Reproduce
Create a po file with a message that uses '%' as percentage in it, such as:
msgid "Build proxy resolution 100% of the original footage dimension"
msgstr ""
then use:
You shall see the output entry above containing a python-format flag:
Expected behavior
Only insert 'python-format' for '%s' or '%d' (as a space holder for the variables)
Your project
https://github.com/hoangduytran/blender_ui
Screenshots
No response
OS
Mac Catalina 10.15.7
Python version
3.8
Sphinx version
3.5.4
Sphinx extensions
No response
Extra tools
https://poedit.net/download
Additional context
No response
The text was updated successfully, but these errors were encountered: