polib
About
A library to parse and manage gettext catalogs.
polib allows you to manipulate, create, modify gettext files (pot, po and mo files). You can load existing files, iterate through it's entries, add, modify entries, comments or metadata, etc... or create new po files from scratch.
polib provides a simple and pythonic API, exporting only three convenience functions 'pofile', 'mofile' and 'detect_encoding', and the 4 core classes: POFile, MOFile, POEntry and MOEntry for creating new files/entries.
Read more | Tutorial | API Documentation | Projects using polib
News
2009/06/06: polib now uses mercurial
to clone the repository, just do :
hg clone https://polib.googlecode.com/hg/ polib
2009/06/05: version 0.4.2 released (another bugfix release)
What's new:
- fixed issue #0007 : use the codecs module to open files,
- fixed issue #0014 : plural forms are not saved correctly in the mo file (thanks lorenzo.gil.sanchez for the patch),
- fixed issue #0015 : no LICENSE file included in tarball,
- removed Version/Date from README,
- added test pot files to MANIFEST.in,
- performance improvment in find() method (thanks Thomas !).
2009/03/04: version 0.4.1 released (bugfix release)
What's new:
- fixed issue #0006 : plural msgstrs were saved unsorted,
- fixed issue #0008 : long comment lines broke 'save()' method,
- removed performance shortcuts: they were in fact inefficient,
- fixed issue #0010 : wrong polib version number,
- fixed issue #0011 : occurrences parsing is now more robust and can handle weird references formats (like in eToys OLPC po files),
- fixed issue #0012 : improved merge() method.
2008/11/26: version 0.4.0 is out !
What's new:
- fixed issue #0005 : percent_translated divide by 0 on empty po files,
- fixed issue #0004 : occurences that have hiphens are wrapped when they should not,
- changes in how encoding is handled,
- remove deprecation warnings for typo "occurences",
- added POEntry.cmp() method to sort entries like gettext does,
- fixed POEntry.transalated(),
- added a merge() method to POFile class, that behaves like the gettext msgmerge utility,
- obsolete entries are now written at the end of the file and with only msgid/msgstr like gettext does,
- fixed some bugs in mo files parsing,
- renamed quote/unquote functions to escape/unescape,
- various cosmetic changes.
2007/12/13: version 0.3.1 released (bugfix release)
What's new:
- fixed issue #0002 : typo: "occurences" instead of "occurrences",
- fixed issue #0003 : mismatch in exception instance names,
- removed deprecation warnings,
- removed unused charset() method in POFile/MOFile objects,
- fixed bug in multibytes string length (added regression tests),
- fixed a bug in detect_encoding(),
- added a find() method to PO/MOFile classes,
- proper handling of quoting and unquoting,
- proper handling of multiline strings in metadata
2007/12/10: polib group created
I created python-polib google group, questions and suggestions are welcome !
2007/11/09: packages for linux distributions published
Various packages for OpenSuse, Suse, Fedora, SLE_10 and Mandriva have been published here, thanks to Nagappan for his time. I hope I'll have some time to create debian and ubuntu packages soon :)
2007/10/17: version 0.3 is out !
What's new:
- speed improvements,
- polib can compile mo files now,
- full unicode support,
- and many bugs fixed.