Bug in SDK 2.0\Sdl.SDK.ProjectAutomation.Samples.BatchAnalyze?

Hello, everyone, I'm Ryota in Japan, feeling a little bit nervous since this is my first post here in this community..

Anyway, I've been trying to develop a TRADOS 2011 batch analysis tool with GUI based on SDK 2.0\Sdl.SDK.ProjectAutomation.Samples.BatchAnalyze but I have noticed that "AddTmFunction" in the code doesn't seem to work properly.

More specifically, even when I specify a non-empty SDLTM running the BatchAnalyze tool, it does not load the specified SDLTM into a sdlproj file it automatically creates so it means I get only repetitions and new segments in an analysis log since no SDLTM was used for the for the analysis.

Is it a known issue or just a problem on my side or by-design behavior?

I've been making a bunch of TRADOS 2011 analysises, each with a different SDLTM, on a daily basisCrying and I'm dying to get this routine of mine automated as soon as possible so aybody who can help me would be greatly appreciated,

Thank you in advanceSmile

Ryota

 

 

 

 

  • Hi Ryota!

    I am securing some developer time to look into your issue and we will feed back when we have looked into it.

    Regards, Ian

    Ian Davies  |  Senior Product Manager | SDL | Language Technologies Division |  +44 7826843819

    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

  • Hi Ryota & Ian,

    I have just taken a look at the code for the sample SDK project that Ryota is making reference to and found a few errors; if you fix these errors then it should work fine…

    I used the same SDK project as a quick approach to test the functionality: "C:\ProgramData\SDL\SDK 2.0\Sdl.SDK.ProjectAutomation.Samples.BatchAnalyze\Sdl.SDK.ProjectAutomation.Samples.BatchAnalyze.sln"

    btw… It was very quick to get it working with the Samle project, excellent work from SDK dev with this Yes

    Hope this helps,

    Patrick.

     

    Issue 1

    Description:  The project confirguation was not updated with the new TM configuration; you need to update the configuration settings of the project after you add the TM entry to the translation provider.

    Solution:  Add this code to the existing ‘AddTM’ function from the Sample code provided in the SDK and it will correctly update the translation provider information in the project.

     

                project.UpdateTranslationProviderConfiguration(

                    new Language(CultureInfo.GetCultureInfo(trgLocale)), config);

     

    Example:

            #region "AddTmFunction"

            private void AddTm(FileBasedProject project, string tmFilePath, string trgLocale)

            #endregion

            {

                #region "TranslationProviderConfiguration"

                TranslationProviderConfiguration config = project.GetTranslationProviderConfiguration();

                #endregion

     

                #region "TranslationProviderCascadeEntry"

                TranslationProviderCascadeEntry tm = new TranslationProviderCascadeEntry(tmFilePath,

                    false, true, true);

     

                config.Entries.Add(tm);

     

                project.UpdateTranslationProviderConfiguration(

                    new Language(CultureInfo.GetCultureInfo(trgLocale)), config);

     

                #endregion

            }

            #endregion

     

     

     

    Issue 2:

    Description: There was one small error in the Program.cs; you need to change the logical operators (Relational) from == to >= in the following area

    Solution:
    change the logical operators (Relational) from == to => in the following area

    Existing Code

      if (args.Length == 3 && !String.IsNullOrEmpty(args[2]) && args[2] == "/y")

                   processSubFolders = true;

     

      if (args.Length == 4 && !String.IsNullOrEmpty(args[3]) && args[3] == "/y")

                  reportCrossFileRepetitions = true;

     

    etc…

     

    Should be…

      if (args.Length >= 3 && !String.IsNullOrEmpty(args[2]) && args[2] == "/y")

                    processSubFolders = true;

     

      if (args.Length >= 4 && !String.IsNullOrEmpty(args[3]) && args[3] == "/y")

                    reportCrossFileRepetitions = true;

     

    etc…

  • Hi, Patrick & Ian,

    Thank you, Patrick, for walking me through with the detailed examples and it's very helpful for me to pinpoint what needs to be doneYes

    I have confirmed that your added line indeed does what it is supposed to do and I have added the following line below "config.Entries.Add(tm);" in the region

    config.Entries.Add(tm);
    config.OverrideParent = true;

    since whatever file is specified as a specific language pair TM won't be actually used by the application unless the following checkbox is set to "true" as shown in the image below.

    I'm very grateful since solving this problem will enable me to complete my own analysis tool at last, which will also allow me to assign my routine task of analyzing to somebody else and eventually to lift quite a load off my shouldersSmile

    An instructional code to add a tm in the "All Language Pairs" section would be nice but I know I'm asking too much!Wink

    Ryota

     

  • Welcome Ryota!

    An SDL architect has this reply for you, thank you for raising this issue to us;

    This problem was due to an eror in the example code for BatchAnalyze.

    The AddTm Function should look like this:

    private void AddTm(FileBasedProject project, string tmFilePath)

    #endregion

    {

    #region "TranslationProviderConfiguration"

    TranslationProviderConfiguration config = project.GetTranslationProviderConfiguration();

    #endregion

    #region "TranslationProviderCascadeEntry"

    TranslationProviderCascadeEntry tm = new TranslationProviderCascadeEntry(

    tmFilePath,

    true,

    true,

    false);

    config.Entries.Add(tm);

    project.UpdateTranslationProviderConfiguration(config);

    #endregion

    }

    Both the example in the SDK package and the online help have been updated.

    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

  • Hi, Ian

    Sorry for not having responded for a whileEmbarrassed

    > Both the example in the SDK package and the online help have been updated. I've been having difficulty in downloading

    I've been having difficulty with downloading it so I haven't got it, yet, and I hope what Patrick initially pointed out (logical operator thing) has been also validated  and incorporated in the package if necessary.

    Thank you for your workYes

    Ryota