Commit 6a98e841 authored by Michal Čihař's avatar Michal Čihař

Workaround broken API in translate-toolkit

It seems that non working setcontext is there by design, so let's use
the attributes directly.

See https://github.com/translate/translate/pull/3433Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 8af23977
......@@ -113,6 +113,8 @@ class BaseExporter(object):
self.handle_plurals(unit.get_target_plurals())
)
output.setcontext(self.string_filter(unit.context))
if hasattr(output, 'msgctxt'):
output.msgctxt = [self.string_filter(unit.context)]
for location in unit.location.split():
if location:
output.addlocation(location)
......
......@@ -125,5 +125,4 @@ class TBXExporterTest(PoExporterTest):
class MoExporterTest(PoExporterTest):
_class = MoExporter
# Not supported in current translate-toolkit, but PR submitted
_has_context = None
_has_context = True
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment