Adding Microsoft Translator Provider to TranslationProviderConfiguration via. API

Hi guys

I hope this OK to post this here? I can't seems to get access / allowed to add a post in 'Studio Developers Q&A' forum



We have a application that pretranslate and analyse Studio 2022 projects via API calls.

We would like to make use of Microsoft Translator Provider to certain languages combinations but can’t seems to get it working.

We already use DeepL, and of course our own Groupshare server, and they works just by adding the credentials like for instance for DeepL

fileBasedProject.Credentials.AddCredential(new Uri("deepltranslationprovider:///"), credential);  and similar for GS

We can also add Microsoft Translator Provider credentials where we use this as URI string "microsofttranslatorprovider:///" and our token/password and that seems like it’s working, ( we don’t get the ‘Unauthorized’ message when adding this ),  but we get a error message like below when running for instance the

fileBasedProject.RunAutomaticTasks(targetLanguageFiles.GetIds(), new[]

{
AutomaticTaskTemplateIds.PreTranslateFiles

//Or        

AutomaticTaskTemplateIds.AnalyzeFiles
}


 
I found this article on how to add BeGlobal Enterprise Machine Translation Provider and GoogleTM Machine Translation Provider but I can’t find one similar for Microsoft Translator Provider.

I hope someone here might be able to point me in the right direction?

 
developers.rws.com/.../adding_translation_memories.html

 
Parameternavn: input

    ved System.Text.RegularExpressions.Regex.Matches(String input)

   ved MicrosoftTranslatorProvider.Helpers.TagPlacer.MarkTags(String translation, String pattern)

MicrosoftTranslatorProvider.Helpers.TagPlacer: 2024-03-20 20:42:13.1674 Error LogException En værdi må ikke være null.

Parameternavn: input

    ved System.Text.RegularExpressions.Regex.Matches(String input)

   ved MicrosoftTranslatorProvider.Helpers.TagPlacer.MarkTags(String translation, String pattern)

MicrosoftTranslatorProvider.Helpers.TagPlacer: 2024-03-20 20:42:13.1674 Error LogException En værdi må ikke være null.

Parameternavn: input

    ved System.Text.RegularExpressions.Regex.Matches(String input)

   ved MicrosoftTranslatorProvider.Helpers.TagPlacer.MarkTags(String translation, String pattern)

MicrosoftTranslatorProvider.Helpers.TagPlacer: 2024-03-20 20:42:13.1674 Error LogException En værdi må ikke være null.

Parameternavn: input

    ved System.Text.RegularExpressions.Regex.Matches(String input)

   ved MicrosoftTranslatorProvider.Helpers.TagPlacer.MarkTags(String translation, String pattern)

MicrosoftTranslatorProvider.Helpers.TagPlacer: 2024-03-20 20:42:13.1764 Error LogException Objektreferencen er ikke indstillet til en forekomst af et objekt.

    ved MicrosoftTranslatorProvider.Helpers.TagPlacer.GetTargetElements()

   ved MicrosoftTranslatorProvider.Helpers.TagPlacer.TryGetTaggedSegment(String returnedText)

   ved MicrosoftTranslatorProvider.Helpers.TagPlacer.GetTaggedSegment(String returnedText)


Thank you for any thoughts
Best regards

Rasmus



Moved text to code block
[edited by: Paul at 2:05 PM (GMT 1) on 11 Apr 2024]
emoji