Message330859
I have followed SilentGhost's advice and begun by thoroughly testing the current behaviour. I then realized that I was wrong, and that (probably by chance) msgfmt.py partially followed my requirements, but pybabel did not and GNU gettext msgfmt did not really. I wrote 2 tiny po files (joined) and played with them, meaning I tried to combine them with pybabel, msgfmt.py and GNU gettext msg. Current behaviour (Windows shell syntax):
> pybabel compile -o .\file12-fr.mo -l fr -i file1-fr.po -i file2-fr.po
only uses second file (file2-fr.po)
> msgfmt -o file12-fr.mo --no-hash file1-fr.po file2-fr.po
chokes on a repeated key on file2 (the header has "" for key...). It works fine anyway after commenting out the header in any of the files
> python "path\to\Tools\i18n\msgfmt.py" -o file12py-fr.mo file1-fr.po file2-fr.po
unexpectedly produces the expected result and successfully combines both po files into one single mo file
BUT:
> python "path\to\Tools\i18n\msgfmt.py" file1-fr.po file2-fr.po
Produces file1-fr.mo which is the compiled version of file1-fr.po and file2-fr.mo which combines both input files. Definitely not an expected result!
This is caused by the problem identified in issue 9741 (https://bugs.python.org/issue9741)
My initial goal was to be able to use the make function from msgfmt.py in an external script. I then realize that combining multiple po files is not a good idea because the resulting mo file can only contain one single header and the best behaviour is GNU gettext msgfmt one.
I now wonder whether this issue should not be closed because the requirement is not relevant, and it would probably better to propose a fix (including tests and code improvement) for issue 9741. |
|
Date |
User |
Action |
Args |
2018-12-01 18:33:52 | s-ball | set | recipients:
+ s-ball, SilentGhost |
2018-12-01 18:33:52 | s-ball | set | messageid: <1543689232.07.0.788709270274.issue35335@psf.upfronthosting.co.za> |
2018-12-01 18:33:52 | s-ball | link | issue35335 messages |
2018-12-01 18:33:51 | s-ball | create | |
|