Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use Machine Translation #2

Open
sergei-lamce opened this issue May 26, 2020 · 2 comments
Open

Can't use Machine Translation #2

sergei-lamce opened this issue May 26, 2020 · 2 comments

Comments

@sergei-lamce
Copy link

Hi,

All functions of STraSAK are working perfectly fine, but when it comes to using Machine Translation, I get the following error:

Microsoft Windows [Version 10.0.18363.719]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Windows\system32>Call "C:\My Scripts\TS2017.cmd"  New-Project -Name "Sample_Project" -PrjLoc "\\Mac\Home\Desktop\Path\Project" -SrcLoc "\\Mac\Home\Desktop\Path\Source" -SrcLng "en-US" -TrgLng "nl-NL" -TMLoc "\\Mac\Home\Desktop\Path\Working TM" -LogLocation "\\Mac\Home\Desktop\Path\Log Files" -PrjTpl "\\Mac\Home\Desktop\Path\Template\Machine_Translation.sdltpl" -Pretranslate -Analyze

Creating new project...
log4net:ERROR Failed to find configuration section 'log4net' in the application's .config file. Check your .config file for the <log4net> and <configSections> elements. The configuration section should look like: <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />

Assigning TMs to project...
\\Mac\Home\Desktop\Path\Working TM\FileBased_TM_NL.sdltm added to project

Adding source files...
Done

Running preparation tasks...
Task Scan
   50%  Started
Information: There are multiple matching file type settings found: Graphics, XML: Any v 1.2.0.0
  100%  Completed
Task Scan successfully completed.
Task Convert to Translatable Format
  100%  Completed
Task Convert to Translatable Format successfully completed.
Task Copy to Target Languages
  100%  Completed
Task Copy to Target Languages successfully completed.
Done

Running automatic tasks...
    0%  Started
Error: Unexpected exception when initializing task 'Analyze Files': Failed to create an instance of translation provider 'modernmt:///?sm=20629&k=NntgyUTgrPStYcXvlxKGMYcw8DDbklfVqhWUB+jf+WKaICIdBBrR39KfkEfJgTmodp7jIh0/sK0E1+gsOKD81d4MQXQeIoAMF8zIeRHmfmlDP222MhYuoTIoCNYZ1EVRoJzF7ituY4/4m8jyue+Cfxe6N7Rmu49LCJ8hMm+NxBk='..
Sdl.ProjectAutomation.Core.ProjectAutomationException: Unexpected exception when initializing task 'Analyze Files': Failed to create an instance of translation provider 'modernmt:///?sm=20629&k=NntgyUTgrPStYcXvlxKGMYcw8DDbklfVqhWUB+jf+WKaICIdBBrR39KfkEfJgTmodp7jIh0/sK0E1+gsOKD81d4MQXQeIoAMF8zIeRHmfmlDP222MhYuoTIoCNYZ1EVRoJzF7ituY4/4m8jyue+Cfxe6N7Rmu49LCJ8hMm+NxBk='.. ---> Sdl.ProjectApi.ProjectApiException: Unexpected exception when initializing task 'Analyze Files': Failed to create an instance of translation provider 'modernmt:///?sm=20629&k=NntgyUTgrPStYcXvlxKGMYcw8DDbklfVqhWUB+jf+WKaICIdBBrR39KfkEfJgTmodp7jIh0/sK0E1+gsOKD81d4MQXQeIoAMF8zIeRHmfmlDP222MhYuoTIoCNYZ1EVRoJzF7ituY4/4m8jyue+Cfxe6N7Rmu49LCJ8hMm+NxBk='.. ---> Sdl.ProjectAutomation.Core.ProjectAutomationException: Failed to create an instance of translation provider 'modernmt:///?sm=20629&k=NntgyUTgrPStYcXvlxKGMYcw8DDbklfVqhWUB+jf+WKaICIdBBrR39KfkEfJgTmodp7jIh0/sK0E1+gsOKD81d4MQXQeIoAMF8zIeRHmfmlDP222MhYuoTIoCNYZ1EVRoJzF7ituY4/4m8jyue+Cfxe6N7Rmu49LCJ8hMm+NxBk='. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: element
   at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit)
   at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit)
   at System.Reflection.CustomAttributeExtensions.GetCustomAttribute[T](Assembly element)
   at ModernMT.Core.PluginInfo..ctor()
   at ModernMT.Plugin.ModernMTProviderFactory..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at Sdl.Core.PluginFramework.DefaultObjectResolver.CreateObject(Type objectType, XElement attributeElement)
   at Sdl.Core.PluginFramework.Implementation.Extension.CreateInstance()
   at Sdl.Core.PluginFramework.ObjectRegistry`2.CreateObjects()
   at Sdl.LanguagePlatform.TranslationMemoryApi.TranslationProviderManager.GetTranslationProviderFactories()
   at Sdl.LanguagePlatform.TranslationMemoryApi.TranslationProviderManager.CreateTranslationProvider(Uri translationProviderUri, String translationProviderState, ITranslationProviderCredentialStore credentialStore)
   at Sdl.ProjectApi.TranslationProviderCache.CreateTranslationProvider(Uri translationProviderUri, String translationProviderState, ITranslationProviderCredentialStore credentialStore)
   at Sdl.ProjectApi.TranslationProviderCache.GetTranslationProvider(Uri translationProviderUri, String translationProviderState, ITranslationProviderCredentialStore credentialStore, Boolean performUpdate, Boolean refreshCache)
   at Sdl.ProjectApi.Helpers.ProjectCascadeFactory.GetTranslationProviderLanguageDirection(TranslationProviderItem translationProviderItem, LanguagePair languageDirection, Boolean performUpdate, Boolean refreshCache)
   --- End of inner exception stack trace ---
   at Sdl.ProjectAutomation.FileBased.Internal.AutomationServerEvents.HandleTranslationProviderException(TranslationProviderItem translationProviderItem, Exception exception)
   at Sdl.ProjectApi.Helpers.ProjectCascadeFactory.GetTranslationProviderLanguageDirection(TranslationProviderItem translationProviderItem, LanguagePair languageDirection, Boolean performUpdate, Boolean refreshCache)
   at Sdl.ProjectApi.Helpers.ProjectCascadeFactory.CreateProjectCascadeEntries(IList`1 projectCascadeEntryDataList, LanguagePair languagePair, Boolean readOnly, Boolean refreshCache)
   at Sdl.ProjectApi.Helpers.ProjectCascadeFactory.CreateCascade(ProjectCascadeSettings projectCascadeSettings, Boolean refreshCache)
   at Sdl.ProjectApi.Helpers.LanguageDirectionHelper.CreateCascade(ILanguageDirection languageDirection, ProjectCascadeEntryDataFilterFunction filter, IComparer`1 sort, Boolean readOnly, Boolean refreshCache)
   at Sdl.ProjectApi.Helpers.LanguageObjectsCache.<>c__DisplayClass5_0.<GetRecognizers>b__0()
   at Sdl.ProjectApi.Helpers.LanguageObjectsCache.GetOrCreateObject(String key, Func`1 createObject)
   at Sdl.ProjectApi.Helpers.LanguageObjectsCache.GetRecognizers(ILanguageDirection languageDirection)
   at Sdl.ProjectApi.Helpers.LanguageObjectsCache.GetLanguageTools(ILanguageDirection languageDirection)
   at Sdl.ProjectApi.AutomaticTasks.Analysis.AnalysisDataCollectorX.CreateAnalysisDataStorage(ILanguageDirection languageDirection, AnalysisTaskSettings analysisSettings, TranslationMemorySettings translationMemorySettings, ILanguageObjectsCache objectsCache)
   at Sdl.ProjectApi.AutomaticTasks.Analysis.AnalysisDataCollectorX.Initialize(IList`1 files)
   at Sdl.ProjectApi.AutomaticTasks.Analysis.AnalysisTask.CreateAnalysisDataCollectors()
   at Sdl.ProjectApi.AutomaticTasks.Analysis.AnalysisTask.InitializeTask(IExecutingAutomaticTask task)
   at Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.InitializeTaskImplementations()
   --- End of inner exception stack trace ---
   at Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.InitializeTaskImplementations()
   at Sdl.ProjectApi.Implementation.TaskExecution.ContentProcessingTaskImplementation.Execute()
   at Sdl.ProjectApi.Implementation.AutomaticTaskExecuter.Execute()
   --- End of inner exception stack trace ---
Task Pre-translate Files+Analyze Files failed.
Unexpected exception when initializing task 'Analyze Files': Failed to create an instance of translation provider 'modernmt:///?sm=20629&k=NntgyUTgrPStYcXvlxKGMYcw8DDbklfVqhWUB+jf+WKaICIdBBrR39KfkEfJgTmodp7jIh0/sK0E1+gsOKD81d4MQXQeIoAMF8zIeRHmfmlDP222MhYuoTIoCNYZ1EVRoJzF7ituY4/4m8jyue+Cfxe6N7Rmu49LCJ8hMm+NxBk='..

Saving logs...
Done

Saving project...
Done

C:\Windows\system32>

Tried with Studio 2019, but the same.
I'm using ModernMT, but I guess it's the same for all other machine translation providers.
The strange part is that even if I try to create a project without specifying the MT, I still get the same error. Only after I uninstall the plugin I don't get this error.

Not sure if this is a plugin error as creating the same manually works fine.

Any idea how to solve this?

Thanks a lot,
Sergei

@EvzenP
Copy link
Owner

EvzenP commented May 26, 2020

Hi Sergei,

looks like this is because STraSAK is originally designed to work with filebased TMs only and cannot use any other translation providers (server-based providers like GroupShare, machine translation services, etc.).

I think the reason you are getting the error even in project without MT is that the MT is still defined somewhere in the Analyze Files task.

Evzen

@sergei-lamce
Copy link
Author

Hi Evzen,

It's clear now and yes, that makes sense. Leaving this "ticket" open, maybe there could be a way to make STraSAK handle machine translation services.

Thanks,
Sergei

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants