I need to merge/update/delete .po files messages and need some Python package which allow me to parse fully .po files including: messages, plurals, location, context and comments.
I want do simple tool which will check differences between to files. I could use also some GUI is already done but not sure if there such tool which will add new translation or remove not used translation.
I was search some articles but not found how to do it. Please recommend some Python package which parse .po fully (could other language) or tool to do such important task to keep good translations.
The polib package is very good. It parses the file and presents several ways to access the data, including an iterator to loop through the msgid, msgstr pairs to do whatever you need. Here is the Quick Start documentation.
It can also parse a .mo if the .po isn't available, specially handle obsolete message strings, iterate over only translated strings, and other nice features.
Try the babel module. it includes a .po parser in babel.messages.catalog and babel.messages.pofile among other things.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With