Language Resource Update in GroupShare

Hi,

we created TMs on GroupShare using PowerShell (with reference to language resources). Now, a colleague wants to change the settings of a language resource, e.g. removing some variables. A background task is started, propagating language resource changes. But there is a System.InvalidOperationException and the task does not finish.

Here is the complete error message:

- <InvalidOperationException xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.datacontract.org/2004/07/System">
  <ClassName xmlns="" i:type="x:string">System.InvalidOperationException</ClassName>
  <Message xmlns="" i:type="x:string">No language resource for language en-US and type Variables found to update.</Message>
  <Data xmlns="" i:nil="true" />
  <InnerException xmlns="" i:nil="true" />
  <HelpURL xmlns="" i:nil="true" />
  <StackTraceString xmlns="" i:type="x:string">at Sdl.LanguagePlatform.TranslationMemoryApi.TMLanguageResourceUpdater.UpdateTm(LanguageResourceGroupChangeSet changeSet) at Sdl.LanguagePlatform.ServerBasedTranslationMemory.Services.TranslationMemoryAdministration.ApplyLanguageResourceGroupChangeSet(Identity translationMemoryId, LanguageResourceGroupChangeSet changeset) at Sdl.LanguagePlatform.ServerBasedTranslationMemory.Tasks.ApplyLanguageResourceChangeSetWorkItem.Execute() at Sdl.Enterprise2.Platform.Execution.WorkItemSlotEntry.ForwardCall() at Sdl.Enterprise2.Platform.Execution.WorkItemSlotEntry.RunCallback(Object state)</StackTraceString>
  <RemoteStackTraceString xmlns="" i:nil="true" />
  <RemoteStackIndex xmlns="" i:type="x:int">0</RemoteStackIndex>
  <ExceptionMethod xmlns="" i:type="x:string">8 UpdateTm Sdl.LanguagePlatform.TranslationMemoryApi, Version=1.6.0.0, Culture=neutral, PublicKeyToken=c28cdb26c445c888 Sdl.LanguagePlatform.TranslationMemoryApi.TMLanguageResourceUpdater Void UpdateTm(Sdl.LanguagePlatform.ServerBasedTranslationMemory.Contracts.LanguageResourceGroupChangeSet)</ExceptionMethod>
  <HResult xmlns="" i:type="x:int">-2146233079</HResult>
  <Source xmlns="" i:type="x:string">Sdl.LanguagePlatform.TranslationMemoryApi</Source>
  <WatsonBuckets xmlns="" i:nil="true" />
  </InvalidOperationException>

Why does this error appear and what has to be done to solve it?

Thanks a lot!
Simon
  • To add a few remarks:

    When you try to unlink the language resource in question from a TM created by the script, you just get the same error message.

    When you try to link another language resource, you get the same error message.

    Could the PowerShell script (just using the Studio assemblies) anyhow try to create a new language resource, overwriting an existing one with attached language directions?

  • To clarify: We create TMs using the API. During creation, the TMs are linked to existing language resources. If a language resource is afterwards changed on GroupShare directly and these changes are to be propagated, there is the above mentioned error message.

    The possibility of changing language resources should be given. How can this be achieved?

    Thanks for your much needed support.

  • Hi Simon,

    I tried with the following C# code, it works fine. The code add a new variable to the language resource. For powershell it is the same. Hope this works fior you too.

    public void Test()

    {    

       var uri = new Uri("http://mygs");

       var server = new Sdl.LanguagePlatform.TranslationMemoryApi.TranslationProviderServer(uri, false, "sa", "sa");

       const string tmPath = "/rTM";

       var tm = server.GetTranslationMemory(tmPath, Sdl.LanguagePlatform.TranslationMemoryApi.TranslationMemoryProperties.All);

       var languageTemplate = tm.LanguageResourcesTemplate;

       var bundle = languageTemplate.LanguageResourceBundles.First();

       bundle.Variables.Add("TestAddNewVariable");

       languageTemplate.Save();

    }