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
As mentioned in this bug report Message.locations duplicate unnecessary #10104, I found several problem with the current babel code, specifically with PYTHON_FORMAT pattern, mentioned in the catalog.py and the way that comments are written, as mentioned in the pofile.py.
The PYTHON_FORMAT pattern recognise lines with percentage signs as a python-format and wrongly flagging the message being a python-format, but when loading into editors such as POEdit, the application shown that this is WRONG. I'm translating for Blender.org at the moment and this has caused so much time correcting the file that I ended up taking a look into the Python code and debugging it to find out the reason why. It turned out to be that this pattern, PYTHON_FORMAT, in the catalog.py is currently not smart enough and erroneously creating havoc on the read/write of the PO file. This all started due to the fact I needed to write my own merging tool using Python, rather than relying on the buggy xgettext's msgmerge.
The comment blocks are wrapping with the message undesirably, making changes to the source file when there are NO changes whatsoever has been made by the translator. Very annoying, especially when you are observing changes in the source file.
Steps to Reproduce
Down load the PO translation file from the Blender github (vi.po). This file is the one I'm working on at the moment in my own repository (blender_ui)
Make a simple python read/write this file to a new one, and observe the result:
from sphinx_intl import catalog as c
home = os.environ['HOME']
file_path = os.path.join(home, 'vi.po')
out_file = os.path.join(home, 'test_vi.po')
data = c.load_po(file_path)
c.dump_po(out_file, data, line_width=4096) # simulate the --no-wrap flag on the msgmerge of xgettext
Open the test_vi.po file in POEdit and you will see right at the top lines being flagged as WRONG use of python-format.
Notice also that comment lines above the msgid are also WRAPPED.
Actual Results
Expected Results
NO Python format ERRORS in the POEdit
Comment lines are NOT wrapped, but they should be sorted for easier observation on changes in the future.
Reproducibility
Everytime.
Additional Information
In the process of debugging and fixing the code myself, I have reported to Sphinx issue github (Message.locations duplicate unnecessary #10104) without realising that each of the module is being separated and managed by different people. So this is the reason why I have to write the bug report, although changes has been made and a pull request has been created, from this fork (hoangduytranuk/babel). Sorry for being abit unwise here due to this is my first time approaching to sphinx source github.
The text was updated successfully, but these errors were encountered:
Overview Description
As mentioned in this bug report Message.locations duplicate unnecessary #10104, I found several problem with the current babel code, specifically with PYTHON_FORMAT pattern, mentioned in the catalog.py and the way that comments are written, as mentioned in the pofile.py.
Steps to Reproduce
Actual Results
Expected Results
Reproducibility
Everytime.
Additional Information
In the process of debugging and fixing the code myself, I have reported to Sphinx issue github (Message.locations duplicate unnecessary #10104) without realising that each of the module is being separated and managed by different people. So this is the reason why I have to write the bug report, although changes has been made and a pull request has been created, from this fork (hoangduytranuk/babel). Sorry for being abit unwise here due to this is my first time approaching to sphinx source github.
The text was updated successfully, but these errors were encountered: