this is a followup to my post here: Plone gettext .po - msgctxt support?
When a msgctxt marker is included in a translation file, any following terms are not being picked up by the translation machinery, even though they are present in the compiled .mo file (I used virtaal to check this).
This was quite unexpected. Feature, bug? If a bug, where to file a report or PR?
Edited to fix my use of "context" while using translate()
zope.i18n doesn't seem to support a msgctxt parameter
msgid "ham" msgstr "prosciutto" msgctxt "masculine" msgid "cooked" msgstr "cotto" msgid "cheese" msgstr "formaggio" msgid "ice" msgstr "ghiaccio"
for term in (u"ham", u"cooked", u"cheese", u"ice"): message = _(u"%s" % term, default="not translated") print term, message, pl_obj.translate(message)
ham ham prosciutto cooked cooked not translated cheese cheese not translated ice ice not translated
however, if I add msgctxt "" in the "cheese" term
msgctxt "" msgid "cheese" msgstr "formaggio"
ham ham prosciutto cooked cooked not translated cheese cheese formaggio ice ice ghiaccio