XLIFF has trans-unit
's id
and resname
. With POT/PO file, the msgid
is the text to be translated, itself, which, if I understand correctly, means POT/PO files can't distinguish between lexically identical source texts in different contexts (“blah” in the context of “foo” will be seen as the same as “blah” in the context of “bar”). XLIFF can distinguish between both, giving each its own trans-unit
's id
.
I know no runtime library able to access XLIFF file to get translated text, seems all APIs around there only knows about *.mo
file, the binary format generated from *.po
files, so I guess even if one use XLIFF for translation (either for house‑made translation or translations ordered to paid humans), he/she will have to convert the resulting translation to a *.po
or*.mo
file.
Is the assumption in the second paragraph correct? If it's not, then what are the ways to avoid this conversion? If it is correct, then after the comment in the first paragraph, how does this conversion technically works and, most importantly, can‑it or how‑does‑it preserve differentiation between similar looking texts which however are semantically different due to context?
Note about this post: I'm aware there are two questions in one with this post, but as both relates to each others, I don't see a clear way to post it as two questions (which would appear unrelated).
Update
For context, there exist an msgctx
available since gettext
0.15, that is since July 2006. But I can't see any context parameter in, say, gettext
for Python 3. If that's not supported (or not widely supported), this is not better than if it was not there. I feel wary on this.