Problems using MT Enhanced through SDL Project Automation API, works in Studio.

I am creating an external .NET application that uses a Project Template to setup a project, add files from a directory, attach a TM, and then use the MT Enhanced plugin. The Pre-translate Files task is configured so that when no match is found, "Apply automated translation". When we create a New Project and run the Pre-Translate Batch Task through Studio (we are on 2015), it works perfectly. We can see what the TM did and also what the MT did. However, when I try to do it in my application, I am received an error:

{"Unexpected exception when initializing task 'Analyze Files': Authentication failed for translation provider 'mtenhancedprovider:///?sendplaintextonly=False&selectedprovider=Microsoft+Translator&usecatid=False&catid=65c5ca74-d991-4f3f-9374-224861807990-en-US-es-MX-TMX-CUSTOM&resenddrafts=False&usepreedit=False&usepostedit=False&prelookupfilename=&postlookupfilename='.."}

Is there an additional setting that is needed when attempting to use the MT Enhance programmatically? Or will it only work when the task is executed via Studio?

Parents
  • Hi Jeff,

    I have been successful in reproducing the exception that you noted here.  It is not possible to use Sdl.Community.MtEnhancedProvider in the scenario that you have identified, given the latest version of the code.

    Everything that you have done seems to be inline with what I would expect for this type of integration.

    Things to note: the URI should have the same scheme as the Provider (i.e. mtenhancedprovider:///), so that the plugin framework can identify it correctly and similarly adding the credentials with the Uri("mtenhancedprovidermst:///").  

    If you have already added the provider in the template that is used to create the project + the settings (with credentials) being persisted,  then it should work without any additional configuration.  Have you tested that scenario?

    I would suggest to review the Sdl.Community.MtEnhancedProvider solution from Sdl-Community and enhance it to fulfil your requirements, which others might also benefit from in the future.

  • Thanks for your help Patrick. Forgive me if it's a dumb question, but how do I determine the correct Provider scheme? In other words, in Uri("mtenhancedprovidemst:///") how did you know to add the "mst" part?

    Regarding adding the provider in the template, this is the part you are referring to right? Still learning the terminology with Studio so I want to make sure I understand correctly :) 

     

    Trados Studio screenshot showing the Translation Memory and Automated Translation window with a highlighted section for 'Choose TM provider' dropdown menu.

    If so, yes I have tried this. It works fine within the application, but with the API it doesn't. 

    Thank you for your help and patience!



    Generated Image Alt-Text
    [edited by: Trados AI at 1:17 PM (GMT 0) on 5 Mar 2024]
  • Hi  

    Unknown said:
    how do I determine the correct Provider scheme? In other words, in Uri("mtenhancedprovidemst:///") how did you know to add the "mst" part?

    You can find this in the sourcecode in github that  mentioned.  In this case there are actually two as the plugin is a MicrosoftTranslator (mst) and Google Translate (gt) provider:

    mtenhancedprovidergt:///

    mtenhancedprovidermst:///

    On your other question... Patrick will need to answer that.  But I think what he's suggesting is that you effect a change to the MT plugin code on github before you use it in your own creation so that it can use persistent credential settings.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

Reply
  • Hi  

    Unknown said:
    how do I determine the correct Provider scheme? In other words, in Uri("mtenhancedprovidemst:///") how did you know to add the "mst" part?

    You can find this in the sourcecode in github that  mentioned.  In this case there are actually two as the plugin is a MicrosoftTranslator (mst) and Google Translate (gt) provider:

    mtenhancedprovidergt:///

    mtenhancedprovidermst:///

    On your other question... Patrick will need to answer that.  But I think what he's suggesting is that you effect a change to the MT plugin code on github before you use it in your own creation so that it can use persistent credential settings.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

Children
No Data