Commit d3d36a9d authored by Michal Čihař's avatar Michal Čihař

Set correct context when importing monolingual TS file

Fixes #460
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 2f6831ea
......@@ -345,6 +345,15 @@ class FileUnit(object):
self.unit.markfuzzy(fuzzy)
class TSUnit(FileUnit):
def get_context(self):
if self.template is not None:
# Monolingual JSON files
return self.template.getid()
else:
return self.mainunit.getcontext()
class JSONUnit(FileUnit):
def get_locations(self):
return ''
......@@ -880,6 +889,7 @@ class TSFormat(FileFormat):
format_id = 'ts'
loader = ('ts2', 'tsfile')
autoload = ('.ts',)
unit_class = TSUnit
@register_fileformat
......
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