Unknown error in editor when combining SDL Translation Memory with Simple Translation Provider

Hello!

I have a very nasty problem here, and it happens in the Editor window.

My simple project is setup like this:

        Trados Studio project settings showing File based Translation memory 'MemoriaDiTest.sdltm' and Translation provider 'DummyMT' with no errors.

  • File based Translation memory (MemoriaDiTest.sdltm)
  • A super simple Translation provider: DummyMT
  • I have selected the option to "Always provide MT suggestion, even if TM match is available"

So I would expect to have a double suggestion for a segment: one from the Translation Memory (if any) and the other from my DummyMT. However this is the result:

       Trados Studio Editor window displaying an error message 'Translation fail. One or more errors occurred' with no further details.

The error says "Translation fail. One or more errors occurred". Problem is that no details are shown in the Errors tab, nor Messages and if I try to run DummyTM in debug mode, no error occurred, this means that the DummyMT execution went just fine, the problem seems happening in the File-based TM search or in the "merging" of the two results.

DummyMT is truly a trivial project, here you can find the DummyMT source code, however the relevant bits are just the following:

class MyTranslationProviderLanguageDirection : ITranslationProviderLanguageDirection {

...

public SearchResults[] SearchTranslationUnits(SearchSettings settings, TranslationUnit[] translationUnits) {
return SearchTranslationUnitsMasked(settings, translationUnits, null);
}

public SearchResults[] SearchTranslationUnitsMasked(SearchSettings settings, TranslationUnit[] translationUnits, bool[] mask) {
SearchResults[] results = new SearchResults[translationUnits.Length];
for (int i = 0; i < results.Length; i++)
results[i] = (mask == null || mask[i]) ? SearchTranslationUnit(settings, translationUnits[i]) : null;
return results;
}

public SearchResults SearchTranslationUnit(SearchSettings settings, TranslationUnit translationUnit) {
Segment sourceSegment = translationUnit.SourceSegment;
Segment translationSegment = new Segment();
translationSegment.Add("This is just a dummy MT");

return CreateSearchResults(sourceSegment, translationSegment);
}

private SearchResults CreateSearchResults(Segment sourceSegment, Segment translationSegment) {
TranslationUnit translationUnit = new TranslationUnit()
{
SourceSegment = sourceSegment,
TargetSegment = translationSegment,
Origin = TranslationUnitOrigin.AdaptiveMachineTranslation,
ConfirmationLevel = Sdl.Core.Globalization.ConfirmationLevel.Draft,
};

translationUnit.ResourceId = new PersistentObjectToken(translationUnit.GetHashCode(), Guid.Empty);

SearchResults results = new SearchResults()
{
SourceSegment = translationUnit.SourceSegment.Duplicate()
};
results.Add(new SearchResult(translationUnit)
{
ScoringResult = new ScoringResult()
{
BaseScore = 0
}
});

return results;
}
}

So in conclusion, I would like to know how I can actually inspect the error, and/or if you think there is some mistake in the DummyMT code. Unfortunately not being able to log or to see the actual cause of the error makes nay bugfixes nearly impossible.

Thank you all for your help!



Generated Image Alt-Text
[edited by: Trados AI at 1:19 PM (GMT 0) on 5 Mar 2024]
Parents Reply Children
No Data