I've added possibility in XLIFF filter to use trans-unit RESNAME as a identifier for alternative translations. Also there were some changes in ID handling, mainly compatibility with SDLXLIFF sources where can be more than one source-seg entries and discarding of empty entries.
As it is quite a change I publish it here as patch to review. Today Aaron Madlon-Kay posted info on [Omega-dev-tech] group about his implementation of this feature which can be found at branch GIT/topic/aaron/xliff-resname.
Hi cienislaw. I took a look at your patch and I saw that you handled an issue I hadn't considered: that IDs for segments in a segmented trans-unit will be duplicated.
On the other hand your patch doesn't respect existing users' preferences. So I've combined our changes on my branch.
Thank you for feedback, I will be more careful with preferences next time.
I finally had an opportunity to run this through a full project lifecycle, and I found that your patch (and mine, after combining our work) was not handling compilation-time correctly.
The correct ID (=resname) was computed at parse-time, but not at compilation-time. So any alt translations would get dropped in the final translated output.
This is fixed in the branch.
thanx for info, will check this out to remember for any future filter code. and many thanx for checking it in project. does it mean it will be included in in main soon?
I've committed to trunk (r6421).
Some detail on how IDs are determined when using @resname:
@resname is not required to be present or unique in XLIFF. In OmegaT we fall back to the @id if @resname is not present.
Once the OmegaT ID (@resname or @id) is determined, it is then required to be unique within its XLIFF <file>. This is accomplished by appending numerical suffixes ("_1", "_2", ...) if the ID has occurred before.
A segmented <trans-unit> will produce multiple OmegaT segments, and these will be disambiguated as above.
Last edit: Aaron Madlon-Kay 2014-07-04
after those changes XLIFF filter test is failing 3 more situations. probably its nothing, but I'm curious why.
Implemented in SVN (/trunk).
Didier
Implemented in the released version 3.1.3 of OmegaT.
Didier