Commit 1dab6238 authored by Michal Čihař's avatar Michal Čihař

Match monolingual XLIFF on source string

It seems to be usual to ignore IDs in monolingual format and rely on
source string only.

Fixes #939
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 317f395c
......@@ -349,6 +349,8 @@ class XliffUnit(FileUnit):
Returns context of message. In some cases we have to use
ID here to make all backends consistent.
'''
if self.template is not None:
return self.template.source
return self.mainunit.getid().replace(ID_SEPARATOR, '///')
def get_locations(self):
......@@ -964,9 +966,8 @@ class XliffFormat(FileFormat):
def _find_unit_mono(self, context, store):
# Do not use findid as it does not work for empty translations
context = context.replace('///', ID_SEPARATOR)
for search_unit in store.units:
loc = search_unit.getid()
loc = search_unit.source
if loc == context:
return search_unit
......
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