polib appears to be THE library of choice for working with gettext/po files in Python. The docs show how to iterate through message strings, save po and mo files, etc. However, it's not clear to me, how can one edit a specific entry?
Let's say, I iterate over all messages in an existing po file and display them in an HTML form with textareas. By submitting the form, I get - as an example - the original msgid = "Hello World" and the via textarea translated msgstr = "Hallo Welt"
The original part inside the po file may look like this:
#: .\accounts\forms.py:26 .\accounts\registration\forms.py:48
msgid "Hello World"
msgstr ""
or with fuzzy flag set:
#: .\accounts\forms.py:26 .\accounts\registration\forms.py:48
#, fuzzy
msgid "Hello World"
msgstr "Hallo"
Now how do I update this particular translation in the actual po file? And in case this message was marked as "fuzzy", how do I remove this flag?
Any help appreciated ...