Search Results for

    Show / Hide Table of Contents

    Analyzing the Files

    In this chapter we will learn how to implement the functionality for performing the actual file analysis. Note that the analyze files task is applied to the SDLXliff files that were previously copied to the target folder. In a project that involves multiple target languages, an analyze files task needs to be applied separately to each set of target documents.

    Implement another helper function called RunFileAnalysis, which takes a FileBasedProject object as parameter as well as the target language locale as string parameter:

    • C#
    /// <summary>
    /// Runs the actual analyze files task on the SDLXliff target documents.
    /// </summary> 
    private void RunFileAnalysis(FileBasedProject project, string trgLocale)
    

    First, retrieve the target files by applying the GetTargetLanguageFiles method to the project, which takes the appropriate target Language object as parameter:

    • C#
    ProjectFile[] targetFiles = project.GetTargetLanguageFiles(new Language(CultureInfo.GetCultureInfo(trgLocale)));
    

    In the next step, we perform the actual analysis task by applying RunAutomaticTask to the project, which takes the file ids and the automatic task id (i.e. AnalyzeFiles) as parameters:

    • C#
    AutomaticTask analyzeTask = project.RunAutomaticTask(
        targetFiles.GetIds(),
        AutomaticTaskTemplateIds.AnalyzeFiles);
    

    See Also

    Configuring the Analyze Task Settings

    Analyze Files Settings

    • Improve this Doc

    On this page

    • See Also
    Back to top Generated by DocFX