polib
polib copied to clipboard
Pure python library to manipulate, create, modify gettext files (pot, po and mo files).
I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account. -...
It would be great to add the ability to read file path as `pathlib.Path`.
This does fix partially https://github.com/izimobil/polib/issues/120. I've left octal/hexadecimal bit patterns because I have no idea on how to do them.
I've a case in which I'm comparing PO entries without take into account `msgstr` neither `obsolete`. Currently, [I'm duplicating the `POEntry.__cmp__` function](https://github.com/mondeja/mdpo/blob/3b718f8917633a4fe311b8fa0dd6c3d01b4434b8/mdpo/polib.py#L9) adding optional parameters `compare_obsolete` and `compare_msgstr`. Could this...
As far as I can see, polib currently only "Escapes the characters ``\\\\``, ``\\t``, ``\\n``, ``\\r`` and ``"``". msgfmt apparently [supports ](https://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/msgfmt.html) Table 15-1. Escape Sequences \n | newline --...
Hi, I have in-memory mo file contents. How can I read them with `polib`? This returns an empty pofile: ``` import polib mo_bytes = b"\xde\x12\x04\x95\x00\x00\x00\x00\x05\x00\x00\x00\x1c\x00\x00\x00D\x00\x00\x00\x07\x00\x00\x00l\x00\x00\x00\x00\x00\x00\x00\x88\x00\x00\x00\x10\x00\x00\x00\x89\x00\x00\x00\x07\x00\x00\x00\x9a\x00\x00\x00\x0c\x00\x00\x00\xa2\x00\x00\x00\x0b\x00\x00\x00\xaf\x00\x00\x00(\x00\x00\x00\xbb\x00\x00\x00\n\x00\x00\x00\xe4\x00\x00\x00\x10\x00\x00\x00\xef\x00\x00\x00\x0f\x00\x00\x00\x00\x01\x00\x00\x16\x00\x00\x00\x10\x01\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00SNAR_BEZEICHNUNG\x00conform\x00inconclusive\x00non-conform\x00Content-Type: text/plain; charset=UTF-8\n\x00Feldfrucht\x00\xc3\x9cbereinstimmung\x00Nicht eindeutig\x00Keine \xc3\x9cbereinstimmung\x00" mo...
Adding example on how to save a modified entry, as this is no where documented and for starters requires a lot of time to find.
Reproduced in py3.8 and py3.9 Following python warning is appearing in PO files with errors: `/home/travis/build/OCA/pylint-odoo/.tox/pylint/lib/python3.9/site-packages/polib.py:1474: ResourceWarning: unclosed file ` Above is because code is raising errors while is parsing...
Originally reported by: **Luis Alejandro Martínez Faneyth (Bitbucket: [LuisAlejandro](https://bitbucket.org/LuisAlejandro), GitHub: [LuisAlejandro](https://github.com/LuisAlejandro))** ---------------------------------------- I've noticed that syntax errors are being raised as IOError, and i would like if there's a special...
`xgettext -c somefile.c` can produce a po file with an entry like this: ``` msgid "" "this is a long piece of text that should wrap on to multiple lines...