diff --git a/apiconcepts/projectautomation/about_packages.md b/apiconcepts/projectautomation/about_packages.md
index 958d73836d..68991bb834 100644
--- a/apiconcepts/projectautomation/about_packages.md
+++ b/apiconcepts/projectautomation/about_packages.md
@@ -1,9 +1,7 @@
-About Packages
-======
+# About Packages
This section explains how packages are used in order to send around project files and related information to other participants in a localization project (e.g. from project managers to translators).
-Overview
------
+## Overview
The initial phase of a localization project typically consists of a number of automatic steps in which the project files are prepared for translation. When this process is completed, the files will be present in SDLXliff format, with all available translation leverage applied. At this point, they are ready to be translated.
Since the person who prepares the project will typically not be the person who translates and reviews the files, the project files will have to be sent to the translator, who will perform the actual translation work. As explained in [About Tasks](about_tasks.md), a human step in the workflow, like translation, is represented by a manual task.
@@ -42,8 +40,7 @@ For example:
When creating a return package, the system is flexible when it comes to the files to include in that return package. The return package does not necessarily need to contain the exact same set of files that was received in the project package. The user can create partial return packages as and when required, and can also combine files received through multiple project packages in a single return package. The only limitation is the fact that all files in a return package need to belong to the same project.
-Project Packages
-----
+## Project Packages
A project package contains the following information:
* A single manual task.
@@ -54,8 +51,7 @@ A project package contains the following information:
* AutoSuggest dictionaries.
-Return Packages
-----
+## Return Packages
A return package contains the following information:
* The manual tasks for which the return package contains files.
@@ -64,15 +60,13 @@ A return package contains the following information:
A return package does not contain any translation memories. The translated files contained in the return package are generally used to update the main and/or project translation memories.
-API Overview
------
+## API Overview
There are two parts of Project API related to working with packages, serving two main scenarios:
1. **Working with packages within the context of a Project API-based project**: The Project Automation API provides a high-level API for creating and opening packages within the context of a project. See [High-level API](#high-level-package-api).
2. **Working with packages outside of the context of a Project API-based project**: You can manipulate packages independently of a Project API-based project using the Low-level Package API
-High-level Package API
------
+## High-level Package API
When you have an existing Project API-based project, you can create packages from this project using the high-level package functionality integrated into the Project Automation API. The Project Automation API provides the following package-related functionality:
@@ -83,12 +77,11 @@ When you have an existing Project API-based project, you can create packages fro
Each of the methods above returns an object that derives from `IPackageOperation`. This object represents the package operation and can be used to monitor that operation though events and to access the results when the operation is completed. After calling the above methods and attaching the relevant event handlers, call **Start** to start the operation.
During package import operations, certain situations may result in callbacks being invoked to allow external control of the package import process. An example of such a situation is when the package contains files which are older than the files that already exist in the project. A callback allows the calling code to decide whether the file should be overwritten. When doing a package import through Var:ProductName, this results in the user being asked a question. The callback are accessed through the `IPackageImportEvents` interface.
-Low-level Package API
-----
+## Low-level Package API
> [!NOTE]
-> This part of the package API functionality will significantly change going forward. The idea is to produce a separate package API and package format, which is entirely independent of the Project Automation API and the desktop project file format.
+> This part of the package API functionality will significantly change going forward. The goal is to produce a separate package API and format, entirely independent of the Project Automation API and the desktop project file format.
-The Project Automation API also provides functionality to create and open packages independently from a Project API-based project. Use this functionality when creating packages containing content originating from external systems or to open packages for other purposes than importing their content into a Project API-based project.
+The Project Automation API also creates and opens packages independently of a Project API-based project. Use this when packaging content from external systems or when opening packages for purposes other than importing into a project.
The package functionality is implemented as a special type of desktop project, a **package project** (see **IPackageProject**). As a result the API to be used for creating and manipulating package files shares most of its functionality with the API used for creating and manipulating projects.
@@ -104,8 +97,7 @@ The creation of project packages in Var:ProductName is fully wizard-based. Users
The screenshot above highlights the various options that are available when creating a project package.
-See Also
-----------
+## See Also
[Creating a Project Package](creating_a_project_package.md)
[Creating a Return Package](creating_a_return_package.md)
diff --git a/apiconcepts/projectautomation/about_project_files.md b/apiconcepts/projectautomation/about_project_files.md
index 47ed764fdf..2263c2d6f4 100644
--- a/apiconcepts/projectautomation/about_project_files.md
+++ b/apiconcepts/projectautomation/about_project_files.md
@@ -1,29 +1,25 @@
-About Project Files
-====
-This section gives an overview of the types of files that can be part of a localization project and explains how the Var:ProductName models these.
+# About Project Files
+This section provides an overview of file types in a localization project and explains how Var:ProductName models them.
-Project Files
-----
-As mentioned before, the main type of files that play a part in a localizable project are files that should be translated. From now on we will call these files *translatable files*. To be more specific, we define translatable files as files that can be processed and translated using RWS's tools, more specifically files from which the translatable content can be extracted and manipulated through the *File Type Support Framework*. For more information, see [Translatable Files](#translatable-files).
+## Project Files
+The primary files in a localizable project are those that require translation—referred to here as *translatable files*. Specifically, translatable files are those from which the File Type Support Framework can extract and manipulate content. For more information, see [Translatable Files](#translatable-files).
Certain project types may consist of a large quantity of translatable files, which each only contain a small amount of content, for instance a website translation project, or files that were exported from a content management system. To facilitate processing these types of projects, the Var:ProductName offers the ability to merge a number of these files into a single translatable, so that it can be processed and edited as one big unit. Merging files could happen at various stages in the project: upfront as part of project preparation, or on a more ad-hoc basis by a translator who wants to edit multiple files at once. For more information, see [Merged Translatable Files](#merged-translatable-files).
-There are files that need to be localized, but for which RWS does not provide a file type definition that can extract translatable content. An example of these are graphics files that contain text. Those files are called localizable files, which indicates that they can be localized as part of the project, but not through the standard workflow with RWS tools, for instance with a graphics editor. For more information, see [Localizable Files](#localizable-files).
+Some files require localization but lack an RWS file type definition capable of extracting translatable content. Graphics files containing text are a common example. These *localizable files* can be localized within the project, but outside the standard RWS tool workflow—for instance, using a graphics editor. For more information, see [Localizable Files](#localizable-files).
-Another type of files are *reference files*. These are files that need to be part of the project, but that are not expected to be modified during translation, for instance external graphics that are required to preview an HTML file. For more information, see [Reference Files](#reference-files).
+*Reference files* belong to the project but remain unmodified during translation—for example, external graphics required to preview an HTML file. For more information, see [Reference Files](#reference-files).
-Sometimes, processing a translatable file, produces additional files that are linked to that translatable file, and that need to travel throughout the remainder of the translation process. We call those files *auxiliary files*. An example of this is a PDF preview file that is generated for a translatable file, and that can be used for commenting. For more information, see [Auxiliary Files](#localizable-files).
+Processing a translatable file sometimes produces additional linked files that must accompany it through the rest of the translation process. These *auxiliary files* include items such as PDF preview files generated for commenting. For more information, see [Auxiliary Files](#localizable-files).
-File Object Model
----
-**IProjectFile** is the base for all files that can be part of a project and provides common properties and functionality such as the ability the download it, etc.
+## File Object Model
+**IProjectFile** serves as the base for all project files and exposes common properties and functionality, such as downloading.
An **ILanguageFile** is a project file that is associated with a specific project language, which could be a source or a target language. Initially, when a file is added to the system, it is typically a source language file. The source language file then goes through some source language specific processing, for instance, conversion into the SDLXliff file format and segmentation. At some point, a target language file is created for every target language in the project, after which target language- specific processing takes place, such as translation memory analysis and translation. All types of project files are language files and are therefore associated with a specific project language. Every source language file has the ability to find its related target language files and vice-versa.
-All types of project files that can be modified after they have been added to the project are versioned, i.e. a full version history is maintained for these. This includes all files except reference files.
+The system versions all modifiable project files, maintaining a full version history. Reference files are the exception.
-Translatable Files
------
+## Translatable Files
Translatable files are files that can be processed and translated using RWS's tools, i.e. for which a file type definition exists in the File Type Support Framework. As a result, translatable files can carry some additional information:
* **File Type**: Identifies with which file type definition this particular file will be processed. It also specifies any other file-type specific aspects, such as how to preview this file, how to verify the content of this file, which QuickInsert (=special characters or tags that can be inserted during editing) items are valid for use, etc.
@@ -34,20 +30,17 @@ Translatable files are files that can be processed and translated using RWS's to
Translatable files are represented by the `ITranslatableFile` interface in the object model.
-Merged Translatable Files
------
+## Merged Translatable Files
A merged translatable file is a translatable file which is created by merging a number of translation files into one. The Var:ProductName provides capabilities to define which files should be merged into one. Subsequently, the files can actually be merged by creating one consolidated SDLXliff file containing the merged content of all the files. After working on the merged file, it can be split into single files again. Apart from the fact that you can merge and split a merged translatable file, it is just a normal translatable file, and can be manipulated as such.
Merged translatable files are represented by the ```IMergedTranslatableFile``` interface in the object model.
-Localizable Files
------
+## Localizable Files
Localizable files are files that need to be changed as part of the localization process, but that cannot be processed using standard RWS tools (i.e. the File Type Support Framework). As a result of that, localizable files do not have analysis or confirmation statistics. Other than that, localizable files are changeable, versioned files.
Localizable files are represented by the ```ILocalizableFile``` interface in the object model.
-Reference Files
-----
+## Reference Files
Reference files are files that need to be part of the project, for instance for preview reasons, but that can be changed as part of the project. Reference files are language files, which means they are associated with a particular project language.
Reference files are represented by the `IReferenceFile` interface in the object model.
@@ -56,8 +49,7 @@ Reference files are represented by the `IReferenceFile` interface in the object
The screenshot above illustrates how project files are selected in Var:ProductNameWithEdition.
-See also
--------------
+## See also
[Adding Files and Folders](adding_files_and_folders.md)
[Creating a Merged File](creating_a_merged_file.md)
diff --git a/apiconcepts/projectautomation/about_project_translation_memories.md b/apiconcepts/projectautomation/about_project_translation_memories.md
index b67418e389..89b17f3fe9 100644
--- a/apiconcepts/projectautomation/about_project_translation_memories.md
+++ b/apiconcepts/projectautomation/about_project_translation_memories.md
@@ -1,9 +1,7 @@
-About Project Translation Memories
-=====
+# About Project Translation Memories
This section explains what project translation memories are, how they are modeled in the Project Automation API and how they should be used in the recommended workflow.
-Project Translation Memories
-------
+## Project Translation Memories
As explained in the [Project Configuration](project_configuration.md) section, every language direction in a project can have one or more translation providers associated with it. The primary type of translation providers are translation memories, which are used within the project to look up translations. Any new translations created by the user are also added to one or more of these translation memories. The user can specify which of the translation memories in the list are updated.
One issue is that there is no control over which translation units end up in the translation memories. During the course of the project, unreviewed, potentially invalid content ends up in there with no easy way to clean this up. The solution to this is the use *project translation memories*: a project translation memory (project TM) is a translation memory that is created specifically for use within one project, and that is discarded once the project is complete. At the end of the project, when all the files have been translated, reviewed and signed off, all translations within these files are added to the main translation memories (we call the translation memories that are added to a project the "main translation memories" to make a clear distinction with the "project translation memories"). Doing this ensures that the only content that ever ends up in the main translation memories has been reviewed, and that any work in progress or invalid content is kept out of the main translation memories and effectively only occurs in the project translation memories which can be discarded at the end of the project.
@@ -18,6 +16,5 @@ Both file- and server-based project translation memories are supported. Server-b
>
> The use of project translation memories is entirely optional. Users can choose not to use project translation memories for a project.
-See Also
--------
+## See Also
[Project TM Creation Settings](project_tm_creation_settings.md)
diff --git a/apiconcepts/projectautomation/about_projects.md b/apiconcepts/projectautomation/about_projects.md
index 7b5b2ae01a..99573af81e 100644
--- a/apiconcepts/projectautomation/about_projects.md
+++ b/apiconcepts/projectautomation/about_projects.md
@@ -1,17 +1,16 @@
-About Projects
-====
-This section provides a high-level overview of projects in the Project Automation API context.
+# About Projects
+This section provides a high-level overview of projects within the Project Automation API.
-We define a localization project as the data, resources and process required to localize a set of source files in a given language, the source language, into one or more target languages. As implied in this, the main inputs to a translation project are:
+A localization project encompasses the data, resources, and processes required to localize source files from one language (the source language) into one or more target languages. The main inputs to a translation project are:
* **The documents to translate**: Files to translate are the main input, although various other file types come into play in real-life project, as explained in the About Project Files section.
* **The source language**: This is the language of the files that need to be translated. At the moment, projects only support one source language. At the same time, files with mixed-language content are not supported either.
* **The target languages**: A single project models the translations of files into one or more target languages. The main reasons for this are the usefulness of being able to manage this translations together and the fact that some processing (manual and automated) on the source language content can be shared between these translations.
-Apart from the files to translate and the language information, an important aspect of a project is configuration. This configuration ranges from which translation memories and termbases to use for the project, over settings for specific automated steps in the project preparation process or workflow, up to custom settings for integration purposes with external systems. For more information, see [Project Configuration](project_configuration.md).
+Beyond files and language information, project configuration plays a critical role. Configuration covers translation memories and termbases, settings for automated preparation steps, and custom settings for external system integration. For more information, see [Project Configuration](project_configuration.md).
-Apart from data and settings, the process followed during the execution of a localization project is an important aspect. The Project Automation API addresses this through the concepts of tasks, which can be automated (file preparation, translation memory analysis) as well as manual (translation, review). Tasks can be run in an automated fashion, driven by a workflow, or in a more ad-hoc way.
+The execution process of a localization project is equally important. The Project Automation API models this through tasks—both automated (file preparation, translation memory analysis) and manual (translation, review). Tasks can run as part of a workflow or on an ad-hoc basis.
Another important aspect of translation projects is their distributed nature. Frequently, the participants in a single localization project are spread across the globe and vary in size from large corporations, who produce content, over language service providers, who provide localization project management to freelance translators and reviewers. This aspect of localization projects is commonly referred to as the localization supply chain. The Project Automation API provides a way to deal with this, through the concept of packages: work (manual tasks) can be sent across the localization supply chain bundled into packages, containing for instance files to translate together with configuration and settings. These packages can be produced and opened by tools like Var:ProductName. For more information, see [About Packages](about_packages.md).
diff --git a/apiconcepts/projectautomation/about_server_based_projects.md b/apiconcepts/projectautomation/about_server_based_projects.md
index 6250f3f046..cbe58d9a27 100644
--- a/apiconcepts/projectautomation/about_server_based_projects.md
+++ b/apiconcepts/projectautomation/about_server_based_projects.md
@@ -1,17 +1,14 @@
-About Server Based Projects
-=====
+# About Server Based Projects
Group Share 2017 Project Server allows projects to be shared between teams. This chapter explains how to work with server-based projects.
-How server based projects work
-------
+## How server based projects work
Server projects are stored online and allow Studio users to collaborate on translation projects in a more efficient and centralized way. Server projects can have multiple users working on different project files at the same time without having to distribute project packages containing the work to be completed. Project managers are also able to track the progress of the work that has been checked in.
Project Server is a central repository for your server project and the files within that project. Project Server offers project management functionality and controls the permissions for accessing the project and resources within that project
As all work is carried out on a local copy, files must be checked out and downloaded before changes can be made. Once you have finished with a file it must be checked back in and uploaded to the server. All other operations are performed locally on the files just like a standard project.
-Project Server API overview
------
+## Project Server API overview
The API to work with server projects consists of the ProjectServer class and extensions to the FileBasedProject class which allow you to connect to a server and work with the files stored there.
**ProjectServer Class**
@@ -49,8 +46,7 @@ Extensions have been added to the FileBasedProject class to allow the class to w
* Marking the server project as complete.
-See Also
---------
+## See Also
[Connecting a Project to a Project Server](connecting_a_project_to_a_project_server.md)
[Viewing and Deleting Published Projects](viewing_and_deleting_published_projects.md)
diff --git a/apiconcepts/projectautomation/about_tasks.md b/apiconcepts/projectautomation/about_tasks.md
index 5f597034ba..50fe03ab07 100644
--- a/apiconcepts/projectautomation/about_tasks.md
+++ b/apiconcepts/projectautomation/about_tasks.md
@@ -1,14 +1,13 @@
-About Tasks
-====
-There are two types of tasks available:
+# About Tasks
+The API supports two types of tasks:
* **Manual tasks**: For example, translating, editing and proofreading. Manual tasks can only be done by users. They are assigned by the project manager.
* **Automatic tasks**: Are performed by the machine, as they do not require human linguistic skills. Examples of automatic tasks include file analysis, word count, file conversion, etc.
-During or after creating a project you can run one or several automatic tasks on the project files. One important task is the conversion of native file types into a translatable, bilingual format, i.e. into SDLXliff. This is actually the pre-requisite for running any subsequent automatic or manual task such as word count, translation, editing. One of the most common tasks is the file analysis. This task compares the source segments of a document to the TUs of one or several TMs. This task determines the number of matches (i.e. context matches, exact matches, fuzzy matches) that the TMs contain for a particular document as well as the number of repeated segments. This automatic task then generates a report, which can also be printed by the user and which can be used for a cost estimate. Below you see an example of a file analyze report:
+After creating a project, you can run one or more automatic tasks on the project files. One critical task converts native file types into a translatable, bilingual format (SDLXliff). This conversion is a prerequisite for all subsequent tasks—word count, translation, and editing. The file analysis task is one of the most common. It compares source segments against translation units (TUs) in one or more TMs. The task determines match counts (context matches, exact matches, fuzzy matches) and identifies repeated segments. It then generates a report suitable for printing and cost estimation. Below you see an example of a file analyze report:
-Automatic tasks can be combined in a task sequence. Task sequences are usually run on a project immediately after it has been created, e.g.: converting files to SDLXliff, analyzing files, then pre-translating the project files. Below you see an example of a **Prepare** task sequence in Var:ProductName and the single tasks that the sequence contains:
+Automatic tasks can be combined into task sequences. A sequence typically runs immediately after project creation—for example: converting files to SDLXliff, analyzing files, then pre-translating. Below you see an example of a **Prepare** task sequence in Var:ProductName and the single tasks that the sequence contains:
@@ -16,8 +15,7 @@ In Var:ProductName, you can also run automatic tasks on one or several selected
-See Also
------------
+## See Also
[Running Tasks on Project Files](running_tasks_on_project_files.md)
[Automatic Tasks and Tasks Settings](automatic_tasks_and_task_settings.md)
diff --git a/apiconcepts/projectautomation/adding_file_in_the_folder_to_the_project.md b/apiconcepts/projectautomation/adding_file_in_the_folder_to_the_project.md
index f47e601bf6..088c3ff7ac 100644
--- a/apiconcepts/projectautomation/adding_file_in_the_folder_to_the_project.md
+++ b/apiconcepts/projectautomation/adding_file_in_the_folder_to_the_project.md
@@ -1,5 +1,4 @@
-Adding Files in the Folder to the Project
-==
+# Adding Files in the Folder to the Project
In the next step we add the functionality for adding the project files from the specified main folder.
@@ -36,27 +35,19 @@ The complete function for adding and scanning the source files should look as sh
///
/// Adds the files from the specified folder to the project and sets the file use, e.g. translatable or reference.
///
-#region "AddFilesFunction"
private void AddFiles(FileBasedProject project, string folder, bool recursion)
-#endregion
{
- #region "AddFolderWithFiles"
project.AddFolderWithFiles(folder, recursion);
- #endregion
-
- #region "GetSourceLanguageFiles"
ProjectFile[] projectFiles = project.GetSourceLanguageFiles();
AutomaticTask scan = project.RunAutomaticTask(
projectFiles.GetIds(),
AutomaticTaskTemplateIds.Scan);
- #endregion
}
```
***
-See Also
---
+## See Also
[Adding Files and Folders](adding_files_and_folders.md)
diff --git a/apiconcepts/projectautomation/adding_files_and_folders.md b/apiconcepts/projectautomation/adding_files_and_folders.md
index 5ae36935e4..a0c14799fb 100644
--- a/apiconcepts/projectautomation/adding_files_and_folders.md
+++ b/apiconcepts/projectautomation/adding_files_and_folders.md
@@ -1,10 +1,8 @@
-Adding Files and Folders
-==
+# Adding Files and Folders
-In Var:ProductName a project requires at least one translatable file. Translatable files can be, for example, Microsoft Word, PowerPoint, etc. documents. Beyond that, a project can also contain reference files. These are untranslatable (e.g. pictures), which can help translators do their job, as they may contain useful information. In addition to that a project can contain so-called localizable files. Localizable files cannot be processed by Var:ProductName. These can gain be, for example, bitmap graphics. However, these files contain localizable content (e.g. text in screenshots), which has to be handled outside of Var:ProductName. For this, translators can enter the target strings, for example, in a separate text file (legend), or use a graphics program to handle the localizations. This chapter contains an example of how to add files to a project programmatically, and change the file usage to e.g. localizable.
+A Var:ProductName project requires at least one translatable file, such as a Microsoft Word or PowerPoint document. Projects can also contain reference files—untranslatable files (such as images) that provide useful context for translators. A project may additionally contain localizable files. Localizable files cannot be processed by Var:ProductName. These can gain be, for example, bitmap graphics. These files contain localizable content (such as text in screenshots) that must be handled outside Var:ProductName. For this, translators can enter the target strings, for example, in a separate text file (legend), or use a graphics program to handle the localizations. This chapter shows how to add files to a project programmatically and change their usage role.
-Implement the Function for Adding Files
---
+## Implement the Function for Adding Files
To add files to a project, you need to apply the ```AddFiles``` method to the project object. This method takes a string array as parameter that contains the names and the full path of the file(s) to add to the project. In our example, we 'outsource' the string array to a separate helper function called ```AddProjectFiles```, e.g.:
@@ -54,8 +52,7 @@ newProject.AddFolderWithFiles(@"c:\temp", true);
```
***
-Change the File Usage (Role)
---
+## Change the File Usage (Role)
As mentioned above, Var:ProductName allows you to change the file usage manually, for example, if you want to set a * *.ppt* file (which is automatically recognized as a translatable) to reference, because it is not supposed to be translated, but should only be provided for information purposes. The screenshot below illustrates how this is done in the **New Project** wizard of Var:ProductName:
@@ -108,8 +105,7 @@ If you were to open the programmatically created * *.sdlproj* file in Var:Produc

-See Also
---
+## See Also
[Running Tasks on the Project Files](running_tasks_on_project_files.md)
diff --git a/apiconcepts/projectautomation/adding_termbases.md b/apiconcepts/projectautomation/adding_termbases.md
index ab92b159df..2a84645a42 100644
--- a/apiconcepts/projectautomation/adding_termbases.md
+++ b/apiconcepts/projectautomation/adding_termbases.md
@@ -1,10 +1,8 @@
-Adding Termbases
-===
+# Adding Termbases
A project may be associated with one or more (file or server) termbases, which are then used for active terminology recognition during translation. This chapter gives an example of how to programmatically add a termbase (* *.sdltb*) file to a project.
-Add a Termbase File
---
+## Add a Termbase File
Termbases are multilingual databases that contain terms in the different languages. A language in a termbase is also called index. An index can essentially have any name (label). For example, the index German may be called Deutsch, DEU, etc., as MultiTerm allows users complete flexibility when it comes to naming indexes. When adding a termbase to a project Var:ProductName intelligently matches the termbase indexes to the project languages. This is actually what your implementation needs to do as well, so that the correct termbase indexes are used for the corresponding project languages.
@@ -29,8 +27,7 @@ termbaseConfig.Termbases.Add(tb);
```
***
-Configure the Term Recognition Options
---
+## Configure the Term Recognition Options
You may optionally configure the term recognition options through the [TermRecognitionOptions](../../api/projectautomation/Sdl.ProjectAutomation.Core.TermRecognitionOptions.yml) class. There are a number of options that you can fine-tune for the active terminology recognition:
@@ -49,8 +46,7 @@ options.SearchOrder = TermbaseSearchOrder.Hierarchical;
```
***
-Map the Termbase Indexes to the Project Languages
---
+## Map the Termbase Indexes to the Project Languages
It is important that you map the project languages to the termbase indexes. As the indexes of a termbase can have any name, they will usually differ from the project language names. In a 'real' application you will programmatically access the termbase definition and retrieve the index labels and locales. However, for our simplified sample implementation we will just assume that we know the termbase index names and will use a hard-coded string array. Then we create three [Language](../../api/core/Sdl.Core.Globalization.Language.yml) objects for the project source language, and the two project target languages:
@@ -88,8 +84,7 @@ Please note the following:
* The **.sdlproj* file will only contain references to termbases. The termbase files will not be copied into the project folder structure.
* You may also add server termbases to your project. In that case the **.sdlproj* file will contain a reference to the server termbase(s).
-Putting it All Together
---
+## Putting it All Together
The complete function should now look as shown below:
@@ -97,46 +92,28 @@ The complete function should now look as shown below:
```cs
public void AddTermbase(FileBasedProject project, string termbaseFileName)
{
- #region "TbConfig"
TermbaseConfiguration termbaseConfig = project.GetTermbaseConfiguration();
- #endregion
-
- #region "AddTb"
Termbase tb = new LocalTermbase(termbaseFileName);
termbaseConfig.Termbases.Add(tb);
- #endregion
-
- #region "TermRecOptions"
TermRecognitionOptions options = termbaseConfig.TermRecognitionOptions;
options.MinimumMatchValue = 50;
options.SearchDepth = 200;
options.ShowWithNoAvailableTranslation = true;
options.SearchOrder = TermbaseSearchOrder.Hierarchical;
- #endregion
-
- #region "ProjectLanguagesAndTbIndexes"
string[] termbaseIndex = { "English", "German", "French" };
Language projSourceLang = new Language(CultureInfo.GetCultureInfo("en-US"));
Language projTargetLang1 = new Language(CultureInfo.GetCultureInfo("de-DE"));
Language projTargetLang2 = new Language(CultureInfo.GetCultureInfo("fr-FR"));
- #endregion
-
- #region "TermbaseLanguageIndex"
termbaseConfig.LanguageIndexes.Add(new TermbaseLanguageIndex(projSourceLang, termbaseIndex[0]));
termbaseConfig.LanguageIndexes.Add(new TermbaseLanguageIndex(projTargetLang1, termbaseIndex[1]));
termbaseConfig.LanguageIndexes.Add(new TermbaseLanguageIndex(projTargetLang2, termbaseIndex[2]));
- #endregion
-
- #region "UpdateTermbaseConfiguration"
project.UpdateTermbaseConfiguration(termbaseConfig);
- #endregion
}
```
***
-See Also
---
+## See Also
[Adding Translation Memories](adding_translation_memories.md)
diff --git a/apiconcepts/projectautomation/adding_tm_to_the_project.md b/apiconcepts/projectautomation/adding_tm_to_the_project.md
index c90dd9a135..aeffd511db 100644
--- a/apiconcepts/projectautomation/adding_tm_to_the_project.md
+++ b/apiconcepts/projectautomation/adding_tm_to_the_project.md
@@ -1,5 +1,4 @@
-Adding the TM to the Project
-===
+# Adding the TM to the Project
In this step you will learn how to add the translation memory to our project that should be used for the batch analysis process.
@@ -48,15 +47,9 @@ The complete helper function for adding the TM to the project should now look as
/// Adds the TM that should be used for the analysis. The project languages are
/// set according to the TM.
///
-#region "AddTmFunction"
private void AddTm(FileBasedProject project, string tmFilePath)
-#endregion
{
- #region "TranslationProviderConfiguration"
TranslationProviderConfiguration config = project.GetTranslationProviderConfiguration();
- #endregion
-
- #region "TranslationProviderCascadeEntry"
TranslationProviderCascadeEntry tm = new TranslationProviderCascadeEntry(
tmFilePath,
true,
@@ -65,7 +58,6 @@ private void AddTm(FileBasedProject project, string tmFilePath)
config.Entries.Add(tm);
project.UpdateTranslationProviderConfiguration(config);
- #endregion
}
```
***
@@ -124,20 +116,14 @@ The complete helper function for adding the TM to the project should now look as
# [C#](#tab/tabid-9)
```cs
-#region "AddServerTmFunction"
///
/// Add a server TM to be used for anaysis. The project languages are
/// set according to the TM.
///
private void AddServerTm(FileBasedProject project, string serverAddress, string organizationPath, string tmName, bool useWindowsSecurity, string username, string password)
-#endregion
{
- #region "TranslationProviderConfiguration"
Uri tmAddress = new Uri(String.Format("sdltm.{1}{2}/{3}", serverAddress, organizationPath, tmName));
TranslationProviderConfiguration config = project.GetTranslationProviderConfiguration();
- #endregion
-
- #region "TranslationProviderCascadeEntryForServerTM"
TranslationProviderCascadeEntry tm = new TranslationProviderCascadeEntry
(
new TranslationProviderReference(tmAddress),
@@ -147,18 +133,13 @@ private void AddServerTm(FileBasedProject project, string serverAddress, string
);
config.Entries.Add(tm);
project.UpdateTranslationProviderConfiguration(config);
- #endregion
-
- #region "CredentialsForServerTm"
project.Credentials.AddCredential(new Uri(serverAddress), String.Format("user={0};password={1};type=CustomUser", username, password, useWindowsSecurity ? "WindowsUser" : "CustomUser"));
project.UpdateTranslationProviderConfiguration(config);
- #endregion
}
```
***
-See Also
---
+## See Also
[Adding Translation Memories](adding_translation_memories.md)
diff --git a/apiconcepts/projectautomation/adding_translation_memories.md b/apiconcepts/projectautomation/adding_translation_memories.md
index e8e64824f4..1cc32c1d31 100644
--- a/apiconcepts/projectautomation/adding_translation_memories.md
+++ b/apiconcepts/projectautomation/adding_translation_memories.md
@@ -1,9 +1,7 @@
-Adding Translation Memories
-===
+# Adding Translation Memories
Projects can contain one or more translation providers per language directions. These are usually (file or server-based) translation memories (TMs), but they could also include automated translation providers such as Google Translate. TMs are not mandatory, but will usually be part of the project, because without TMs you cannot apply tasks such as creating project TMs, pre-translation, etc. In this chapter you will learn how to programmatically add main TMs to your project.
-Add the Main Translation Memories
---
+## Add the Main Translation Memories
Main TMs are the resources used for pre-translating files and (if applicable) for creating project TMs. When adding TMs to a language pair of a project you can enable it for segment lookup, concordance search and updating. Updating means that the TM is updated during the project lifecycle, i.e. it will be filled with new translation units or existing translation units will be overwritten with updated Translation Units (TUs) from the translated, edited and proofread documents. If you add more than one TM to a project language pair, you will usually only want one TM to be updated while all others should only be used for lookup purposes.
In this example we implement a separate helper function for adding the TMs to our project, which takes a [FileBasedProject](../../api\projectautomation\Sdl.ProjectAutomation.FileBased.FileBasedProject.yml) object and the TM path as parameters:
@@ -94,23 +92,18 @@ Please note the following:
* The TM files can also be added if the corresponding *.sdltm files are not located at the provided location, i.e. the API does not check whether the file TMs are actually present. Therefore, your implementation should check whether the TMs exist, and whether they match the project language directions.
* You may also add server TMs as translation providers and mix them with file TMs and automated translation providers such as Google Translate.
-Putting it All Together
---
+## Putting it All Together
The complete function should look as shown below:
# [C#](#tab/tabid-5)
```CS
public void AddMasterTMs(FileBasedProject project, string path)
{
- #region "TranslationProviderConfiguration"
Language trgLangDe = new Language(CultureInfo.GetCultureInfo("de-DE"));
Language trgLangFr = new Language(CultureInfo.GetCultureInfo("fr-FR"));
TranslationProviderConfiguration tmConfigEnDe = project.GetTranslationProviderConfiguration(trgLangDe);
TranslationProviderConfiguration tmConfigEnFr = project.GetTranslationProviderConfiguration(trgLangFr);
- #endregion
-
- #region "ConfigureTms"
TranslationProviderCascadeEntry[] tmEntriesEnDe =
{
new TranslationProviderCascadeEntry(path + "Software En-De.sdltm", true, true, true, 0),
@@ -122,9 +115,6 @@ public void AddMasterTMs(FileBasedProject project, string path)
new TranslationProviderCascadeEntry(path + "Software En-Fr.sdltm", true, true, true, 0),
new TranslationProviderCascadeEntry(path + "General En-Fr.sdltm", true, true, true, 2)
};
- #endregion
-
- #region "AddTmsAndUpdate"
for (int i = 0; i < tmEntriesEnDe.Length; i++)
{
tmConfigEnDe.Entries.Add(tmEntriesEnDe[i]);
@@ -137,13 +127,11 @@ public void AddMasterTMs(FileBasedProject project, string path)
project.UpdateTranslationProviderConfiguration(trgLangDe, tmConfigEnDe);
project.UpdateTranslationProviderConfiguration(trgLangFr, tmConfigEnFr);
- #endregion
}
```
****
-Adding a file based TM with a password
---
+## Adding a file based TM with a password
If the file TM is password protected you must add the file using the URI method as the credentials to open the files are keyed against the URI
@@ -174,8 +162,7 @@ public void AddFileBasedTMWithPassword(FileBasedProject project, string pathIncl
```
***
-Adding a Server-based TM
---
+## Adding a Server-based TM
For a server-based translation memory, an entry should be added for the TM Server itself. The URI should be of the form:
@@ -216,8 +203,7 @@ private void AddServerBasedTM(FileBasedProject project, Uri uri, string path, st
```
***
-Adding BeGlobal Community Machine Translation Provider
---
+## Adding BeGlobal Community Machine Translation Provider
BeGlobal Translation Provider is a free machine translation service provided by RWS for Studio customers. The URI should be in the form:
beglobalcommunity://
@@ -252,8 +238,7 @@ public void AddBeglobalCommunityMT(FileBasedProject project)
>
>Pre-translate does not use Machine Translation Providers by default. To use this provider in a pre-translate task remember to set the NoTranslationMemoryMatchFoundAction property to ApplyAutomatedTranslation see [Pre-translate Settings](pre_translate_settings.md)
-Adding BeGlobal Enterprise Machine Translation Provider
---
+## Adding BeGlobal Enterprise Machine Translation Provider
BeGlobal Enterprise Edition is a domain based machine translation provider used to provide high quality machine translations for specific application domains. The URI should be in the form:
@@ -289,8 +274,7 @@ public void AddBeglobalEnterpriseMT(FileBasedProject project, string host, strin
>
>Pre-translate does not use Machine Translation Providers by default. To use this provider in a pre-translate task remember to set the **NoTranslationMemoryMatchFoundAction** property to **ApplyAutomatedTranslation** see [Pre-translate Settings](pre_translate_settings.md)
-Adding a GoogleTM Machine Translation Provider
---
+## Adding a GoogleTM Machine Translation Provider
Google TranslateTM is a chargable machine translation service provided by GoogleTM The URI should be in the form:
googlemt://
@@ -328,8 +312,7 @@ public void AddGoogleMT(FileBasedProject project, string apiKey)
>
>Pre-translate does not use Machine Translation Providers by default. To use this provider in a pre-translate task remember to set the **NoTranslationMemoryMatchFoundAction** property to **ApplyAutomatedTranslation** see [Pre-translate Settings](pre_translate_settings.md)
-See Also
---
+## See Also
[Adding Termbases](adding_termbases.md)
diff --git a/apiconcepts/projectautomation/analyze_files_settings.md b/apiconcepts/projectautomation/analyze_files_settings.md
index 55e5d5d91d..37602e385c 100644
--- a/apiconcepts/projectautomation/analyze_files_settings.md
+++ b/apiconcepts/projectautomation/analyze_files_settings.md
@@ -1,11 +1,9 @@
-Analyze Files Settings
-==
+# Analyze Files Settings
The Analyze Files task is used to determine the TM leverage for the selected project file(s). This means that it determines how many TUs of the main TMs match the segments in the project files. The task also determines the rate of repeated segments, i.e. repetitions within a document or cross-file repetitions. The task also determines the total number of segments, words, and characters. Therefore it is even useful when no TMs have been added to the project. This chapter provides detailed information on the various settings that you can configure to fine-tune this task programmatically.
-Configure the Task Settings
---
+## Configure the Task Settings
The screenshot below shows the settings that can be configured for the Analyze Files task in Var:ProductName.
@@ -60,8 +58,7 @@ analyseSettings.UnknownSegmentsMaximumMatchValue.Value = 50;
After configuring all task settings you need to update the project by applying the [UpdateSettings](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml#Sdl_ProjectAutomation_FileBased_FileBasedProject_UpdateSettings_Sdl_Core_Globalization_Language_Sdl_Core_Settings_ISettingsBundle_) method as shown below:
-Putting it All Together
---
+## Putting it All Together
The complete function should look as shown below:
@@ -69,38 +66,20 @@ The complete function should look as shown below:
```CS
public void GetAnalyzeTaskSettings(FileBasedProject project)
{
- #region "AnalysisTaskSettings"
ISettingsBundle settings = project.GetSettings();
AnalysisTaskSettings analyseSettings = settings.GetSettingsGroup();
- #endregion
-
- #region "ReportCrossFileRepetitions"
analyseSettings.ReportCrossFileRepetitions.Value = true;
- #endregion
-
- #region "ReportInternalFuzzyMatchLeverage"
analyseSettings.ReportInternalFuzzyMatchLeverage.Value = true;
- #endregion
-
- #region "ExportFrequentSettings"
analyseSettings.ExportFrequentSegments.Value = true;
analyseSettings.FrequentSegmentsNoOfOccurrences.Value = 5;
- #endregion
-
- #region "ExportUnknownSegments"
analyseSettings.ExportUnknownSegments.Value = true;
analyseSettings.UnknownSegmentsMaximumMatchValue.Value = 50;
- #endregion
-
- #region "UpdateAnalyzeSettings"
project.UpdateSettings(settings);
- #endregion
}
```
***
-See Also
---
+## See Also
diff --git a/apiconcepts/projectautomation/analyzing_the_files.md b/apiconcepts/projectautomation/analyzing_the_files.md
index 92ed5e255e..c0d6438e7e 100644
--- a/apiconcepts/projectautomation/analyzing_the_files.md
+++ b/apiconcepts/projectautomation/analyzing_the_files.md
@@ -1,7 +1,6 @@
-Analyzing the Files
-==
+# 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.
+This chapter explains how to implement the file analysis functionality. The analyze files task operates on the SDLXliff files previously copied to the target folder. For projects with multiple target languages, run the analyze files task separately for each target language.
Implement another helper function called RunFileAnalysis, which takes a [FileBasedProject](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml) object as parameter as well as the target language locale as string parameter:
@@ -32,8 +31,7 @@ AutomaticTask analyzeTask = project.RunAutomaticTask(
```
***
-See Also
---
+## See Also
[Configuring the Analyze Task Settings](configuring_the_analyze_task_settings.md)
diff --git a/apiconcepts/projectautomation/auto_substitution_settings.md b/apiconcepts/projectautomation/auto_substitution_settings.md
index 5a3fd4599e..1afc8bfd1b 100644
--- a/apiconcepts/projectautomation/auto_substitution_settings.md
+++ b/apiconcepts/projectautomation/auto_substitution_settings.md
@@ -1,5 +1,4 @@
-Auto-Substitution Settings
-==
+# Auto-Substitution Settings
Var:ProductName offers the ability to automatically substitute and localize certain elements within a segment, e.g. numbers. Example: The segments '*You owe me 100 dollars.*' and '*You owe me 2,000 dollars.*' are regarded as being identical, because the only difference here is a number, which can be automatically substituted. Moreover, Var:ProductName can also auto-localize the number format. For example, the number '2,000' in English needs to be localized into '2.000' when the target language is e.g. German.
@@ -56,8 +55,7 @@ tmSettings.MeasurementsFormattingMode.Value = Settings.MeasurementsFormattingMod
***
-See Also
---
+## See Also
[Translation Memory Search Settings](translation_memory_search_settings.md)
diff --git a/apiconcepts/projectautomation/automatic_tasks_and_task_settings.md b/apiconcepts/projectautomation/automatic_tasks_and_task_settings.md
index e4820d7cad..65df9bf39e 100644
--- a/apiconcepts/projectautomation/automatic_tasks_and_task_settings.md
+++ b/apiconcepts/projectautomation/automatic_tasks_and_task_settings.md
@@ -1,5 +1,4 @@
-Automatic Tasks and Task Settings
-==
+# Automatic Tasks and Task Settings
he tasks performed in a project can be configured and customized through various settings to suit particular project requirements. For example, the pre-translate task by default only processes exact matches and context matches. However, through a specific setting you can also allow this task to process e.g. matches down to 95%. For another project, a minimum match value of 85% might be suitable.
@@ -53,8 +52,7 @@ project.UpdateSettings(trgLanguage, settings);
Note that the above is just one example of a task configuration setting. You will find detailed information on available batch tasks and their settings on the bottom of this page under *See Also* . Note that the task settings are physically stored in the project (* *.sdlproj*) file.
-Putting it All Together
---
+## Putting it All Together
The complete function should look as shown below:
@@ -62,28 +60,16 @@ The complete function should look as shown below:
```CS
public void ConfigureBatchTaskSettings(FileBasedProject project, string trgLocale, int minMatchValue)
{
- #region "SetLanguage"
Language trgLanguage = new Language(CultureInfo.GetCultureInfo(trgLocale));
- #endregion
-
- #region "TaskSettings"
ISettingsBundle settings = project.GetSettings(trgLanguage);
TranslateTaskSettings pretranslateSettings = settings.GetSettingsGroup();
- #endregion
-
- #region "MinimumMatchScore"
pretranslateSettings.MinimumMatchScore.Value = minMatchValue;
- #endregion
-
- #region "UpdateSettings"
project.UpdateSettings(trgLanguage, settings);
- #endregion
}
```
***
-See Also
---
+## See Also
[Pre-translate Settings](pre_translate_settings.md)
[Analyze Files Settings](analyze_files_settings.md)
diff --git a/apiconcepts/projectautomation/checking_files_in_and_out.md b/apiconcepts/projectautomation/checking_files_in_and_out.md
index df20348fe8..05ffd7001c 100644
--- a/apiconcepts/projectautomation/checking_files_in_and_out.md
+++ b/apiconcepts/projectautomation/checking_files_in_and_out.md
@@ -1,5 +1,4 @@
-Checking Files In and Out
-==
+# Checking Files In and Out
To modify a file on a server project you will need to check it out from the server so that you have exclusive access. Once you have performed any modifications you will need to check in the file again to make a new version of the file available to other users of the project.
You will need to check in files when you have:
@@ -9,8 +8,7 @@ You will need to check in files when you have:
The [FileBasedProject](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml) object provides methods to check files in and out.
-Local file state
---
+## Local file state
As you work on files in a server project the local file state will change do indicate the status of the local copy in relation to the file on the server. The file can be in one of the following states. These are represented in the enumeration [LocalFileState](../../api/projectautomation/Sdl.ProjectAutomation.Core.LocalFileState.yml)
@@ -46,8 +44,7 @@ As you work on files in a server project the local file state will change do ind
>
>The [LocalFileState](../../api/projectautomation/Sdl.ProjectAutomation.Core.ProjectFile.yml#Sdl_ProjectAutomation_Core_ProjectFile_LocalFileState) can be accessed from the [ProjectFile](../../api/projectautomation/Sdl.ProjectAutomation.Core.ProjectFile.yml) object. As Project Automation API works on a snapshot, you must get the file information from the project again to update the status.
-Checking out files
---
+## Checking out files
When you open files for translation or review, run a batch task or create a package, you must check the files out first. Use the [CheckoutFiles](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml#Sdl_ProjectAutomation_FileBased_FileBasedProject_CheckoutFiles_System_Guid___System_Boolean_System_EventHandler_Sdl_ProjectAutomation_Core_ProgressEventArgs__) method to check out the file. If the local copy of the file is out of date or missing then it will be automatically downloaded from the server. If the local file has been modified it will not be downloaded unless the override parameter is set to true.
@@ -70,8 +67,7 @@ project.CheckoutFiles(fileIds, false,
>
>You only need to check out files once the project has been published. You can process files without check out before that.
-Checking in a new version of a file
---
+## Checking in a new version of a file
When you open a file for translation or review, run a batch task or create a package, you must first check out the files from the Project Server. Once complete, you need to update the files on the Project Server with your locally modified files by checking them in.
@@ -94,8 +90,7 @@ project.CheckinFiles(fileIds, "This is where you add a check in comment",
>
>Use the [CheckinFiles](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml#Sdl_ProjectAutomation_FileBased_FileBasedProject_CheckinFiles_System_Guid___System_String_System_EventHandler_Sdl_ProjectAutomation_Core_ProgressEventArgs__) method when checking in a new or modified file. This will make sure that a new version of the file is created on the server and that it is available for other users to check out.
-Adding new files to the server
---
+## Adding new files to the server
If you add a new file to a server project, checking in the file uploads it to the Project Server so other users can work with the file. The steps to add a new file are identical to adding a file to a local project but with the one extra step of checking in the files and uploading them to the server.
@@ -124,8 +119,7 @@ project.CheckinFiles(sourceFileIds, "New Source Files",
>
>Use the [CheckinFiles](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml#Sdl_ProjectAutomation_FileBased_FileBasedProject_CheckinFiles_System_Guid___System_String_System_EventHandler_Sdl_ProjectAutomation_Core_ProgressEventArgs__) method when checking in a new or modified file. This will make sure that a new version of the file is created on the server and that it is available for other users to check out.
-Undo file check out
---
+## Undo file check out
To cancel the checkout of one or more files use the [UndoCheckoutFiles](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml#Sdl_ProjectAutomation_FileBased_FileBasedProject_CheckoutFiles_System_Guid___System_Boolean_System_EventHandler_Sdl_ProjectAutomation_Core_ProgressEventArgs__) method. This unlocks the file on the server without changing the version and leaves the local copy untouched.
@@ -139,8 +133,7 @@ project.UndoCheckoutFiles(fileIds);
>
>You can only undo the check out for a file if it was previously checked out. If a file is checked out to another user you must have the "Cancel Checkout of Other Users Project Files" permission on the server.
-See Also
---
+## See Also
[About Server Based Projects](about_server_based_projects.md)
diff --git a/apiconcepts/projectautomation/completing_projects.md b/apiconcepts/projectautomation/completing_projects.md
index 0b7d275a1c..6332058246 100644
--- a/apiconcepts/projectautomation/completing_projects.md
+++ b/apiconcepts/projectautomation/completing_projects.md
@@ -1,5 +1,4 @@
-Completing Projects
-==
+# Completing Projects
Projects can change their states during the translation process. By using the complete functionality you can change for a project the state to completed.
@@ -17,7 +16,6 @@ public void CompleteProject()
You could use this method, for example, when you finished the translation for a project and you want to change the status in completed.
-See Also
---
+## See Also
[Setting the Project Information](setting_the_project_information.md)
diff --git a/apiconcepts/projectautomation/configuring_the_analyze_task_settings.md b/apiconcepts/projectautomation/configuring_the_analyze_task_settings.md
index 2999fe1c8a..afc57ba915 100644
--- a/apiconcepts/projectautomation/configuring_the_analyze_task_settings.md
+++ b/apiconcepts/projectautomation/configuring_the_analyze_task_settings.md
@@ -1,5 +1,4 @@
-Configuring the Analyze Task Settings
-==
+# Configuring the Analyze Task Settings
The automatic analyze files task can be configured through various parameters. In our implementation we will use two parameters: the reporting of cross-file repetitions and of the internal fuzzy match leverage. For detailed information on the available task settings, please see [Analyze Files Settings](analyze_files_settings.md).
@@ -58,7 +57,6 @@ The complete helper function should now look as shown below:
# [C#](#tab/tabid-6)
```cs
-#region "GetAnalyzeSettingsFunction"
///
/// Configures the analyze task file settings, i.e. in our implementation
/// report cross-file repetitions and report the internal fuzzy match leverage.
@@ -68,30 +66,17 @@ private void GetAnalyzeSettings(
string trgLocale,
bool reportCrossFileRepetitions,
bool reportInternalFuzzyMatchLeverage)
-#endregion
{
- #region "trgLanguage"
Language trgLanguage = new Language(CultureInfo.GetCultureInfo(trgLocale));
- #endregion
-
- #region "ISettingsBundle"
ISettingsBundle settings = project.GetSettings(trgLanguage);
AnalysisTaskSettings analyzeSettings = settings.GetSettingsGroup();
- #endregion
-
- #region "ConfigureSettings"
analyzeSettings.ReportCrossFileRepetitions.Value = reportCrossFileRepetitions;
analyzeSettings.ReportInternalFuzzyMatchLeverage.Value = reportInternalFuzzyMatchLeverage;
- #endregion
-
- #region "UpdateSettings"
project.UpdateSettings(trgLanguage, settings);
- #endregion
}
```
***
-See Also
---
+## See Also
[Analyze Files Settings](analyze_files_settings.md)
diff --git a/apiconcepts/projectautomation/configuring_the_project_properties.md b/apiconcepts/projectautomation/configuring_the_project_properties.md
index caa62b4f22..151328fd3c 100644
--- a/apiconcepts/projectautomation/configuring_the_project_properties.md
+++ b/apiconcepts/projectautomation/configuring_the_project_properties.md
@@ -1,5 +1,4 @@
-Configuring the Project Properties
-==
+# Configuring the Project Properties
Before the files can be processed we need to create a project, to which we later add the files to analyze as well as the TM file that should be used for the analysis. For the project creation, we proceed on the following assumptions:
@@ -7,8 +6,7 @@ Before the files can be processed we need to create a project, to which we later
* The project will be created in the Var:ProductName projects folder, e.g. C:\Documents and *Settings\UserName\My Documents\ Var:ProductName \Projects.*
* The project name will be hard-coded and based on the current date/time to ensure that the project folder names are unique.
-Add the Class for the Project Creation
---
+## Add the Class for the Project Creation
Add a new class to your project called ProjectCreator. Make sure that this class uses the namespaces listed in the chapter [Required References and Namespaces](required_references_and_namespaces.md). Moreover, you also need to use the following namespaces from the Translation Memory API:
@@ -17,8 +15,7 @@ Add a new class to your project called ProjectCreator. Make sure that this class
* Sdl.LanguagePlatform.Core.Tokenization
* Sdl.LanguagePlatform.Core
-Create the Project
---
+## Create the Project
Start by implementing a public function called Create. This function takes the following parameters:
@@ -66,8 +63,7 @@ FileBasedProject newProject = new FileBasedProject(this.GetProjectInfo(srcLocale
```
***
-Configure the Project Properties
---
+## Configure the Project Properties
Implement a separate helper function for configuring the project properties called ```GetProjectInfo```. As this function is responsible for setting the project languages, it takes the source and the target locales (e.g.* en-US* and *de-DE*) as string parameters:
@@ -152,8 +148,7 @@ private ProjectInfo GetProjectInfo(string srcLocale, string trgLocale)
```
***
-See Also
---
+## See Also
[Setting the Project Information](setting_the_project_information.md)
diff --git a/apiconcepts/projectautomation/connecting_a_project_to_a_project_server.md b/apiconcepts/projectautomation/connecting_a_project_to_a_project_server.md
index 41b2387a41..4db8e5d206 100644
--- a/apiconcepts/projectautomation/connecting_a_project_to_a_project_server.md
+++ b/apiconcepts/projectautomation/connecting_a_project_to_a_project_server.md
@@ -1,12 +1,10 @@
-Connecting a Project to a Project Server
-==
+# Connecting a Project to a Project Server
Using Trados GroupShare, projects can be shared between many users within an organization. The Automation API provides methods for publishing and accessing server-based projects.
Server-based projects are not accessed directly but through a local copy. Interaction with files in a project through the local copy is just like interacting with a standard project. However additional steps are required to check in, check out files so they are available to all project users.
-Publishing to a Project Server
---
+## Publishing to a Project Server
To share a project on Project Server the project must be published to the server. To do this through the Project Automation API requires calling the [PublishProject](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml#Sdl_ProjectAutomation_FileBased_FileBasedProject_PublishProject_System_Uri_System_Boolean_System_String_System_String_System_String_System_EventHandler_Sdl_ProjectAutomation_FileBased_PublishProjectEventArgs__) method on the [FileBasedProject](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml) object.
@@ -38,8 +36,7 @@ project.PublishProject(
>
>Once a project has been published the local project will become the workspace for this project and you will only need to create a new workspace if you access the project from another machine or you delete the existing workspace.
-Opening a new server project (no local copy available).
---
+## Opening a new server project (no local copy available).
If you do not already have a local copy for a server project you must open the project using the [OpenProject](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.ProjectServer.yml#Sdl_ProjectAutomation_FileBased_ProjectServer_OpenProject_System_Guid_System_String_) method in the [ProjectServer](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.ProjectServer.yml) class. This will create the workspace and return a [FileBasedProject](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml) object.
@@ -66,8 +63,7 @@ FileBasedProject SetupServerProjectLocalCopy(Guid projectId, string locationOfLo
>
>If you already have a workspace attached to a server project then you should create a new [FileBasedProject](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml) using the constructor for this purpose
-Opening a server project from an existing local copy.
---
+## Opening a server project from an existing local copy.
If you already have a local copy of a server project you can open the project using the constructor designed for this purpose on the ```FileBasedProject``` class.
@@ -80,8 +76,7 @@ FileBasedProject project = new FileBasedProject(@"c:\MyProjectDirectory\MyProjec
```
***
-See Also
---
+## See Also
[About Server Based Projects](about_server_based_projects.md)
diff --git a/apiconcepts/projectautomation/converting_the_project_files.md b/apiconcepts/projectautomation/converting_the_project_files.md
index cbd402ff26..c24f849d8c 100644
--- a/apiconcepts/projectautomation/converting_the_project_files.md
+++ b/apiconcepts/projectautomation/converting_the_project_files.md
@@ -1,9 +1,8 @@
-Converting the Project Files
-==
+# Converting the Project Files
-In this step we will generate translatable, bilingual documents (i.e. SDLXliff files) from all translatable documents that have previously been added to our project. After that, we will create target copies of the translatable files, which will then be used for further processing, i.e. for the file analysis.
+This step generates translatable, bilingual documents (SDLXliff files) from all translatable source documents added to the project. It then creates target copies for further processing, such as file analysis.
-Implement another helper function called ```ConvertFiles```, which takes a [FileBasedProject](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml) object as parameter. First, we need to retrieve the ids of the files to which the two automatic tasks (i.e. conversion and copy to a target-language folder) should be applies. To do this we use the [GetSourceLanguageFiles](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml#Sdl_ProjectAutomation_FileBased_FileBasedProject_GetSourceLanguageFiles) method on the project:
+Implement another helper function called ```ConvertFiles```, which takes a [FileBasedProject](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml) object as parameter. First, retrieve the file IDs for conversion and copying to a target-language folder using the [GetSourceLanguageFiles](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml#Sdl_ProjectAutomation_FileBased_FileBasedProject_GetSourceLanguageFiles) method on the project:
# [C#](#tab/tabid-1)
```cs
@@ -11,7 +10,7 @@ ProjectFile[] files = project.GetSourceLanguageFiles();
```
***
-In the next step we apply the [RunAutomaticTask](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml#Sdl_ProjectAutomation_FileBased_FileBasedProject_RunAutomaticTask_System_Guid___System_String_) method to the project in order to run the task that generates the SDLXliff files from the translatable source documents. This method requires the ids of the files to process as well as the task id, here [ConvertToTranslatableFormat](../../api/projectautomation/Sdl.ProjectAutomation.Core.AutomaticTaskTemplateIds.yml#Sdl_ProjectAutomation_Core_AutomaticTaskTemplateIds_ConvertToTranslatableFormat) as parameters. Before we actually convert the source files to a translatable format, we need to make sure that this task is only applied to translatable files. If you try to convert a file for which no file type definition exists (i.e. a reference file), an exception will be thrown. For this reason, we loop through the source documents and only apply the convert task if the [FileRole](../../api/projectautomation/Sdl.ProjectAutomation.Core.FileRole.yml) equals [Translatable](../../api/projectautomation/Sdl.ProjectAutomation.Core.FileRole.yml#fields):
+Next, apply the [RunAutomaticTask](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml#Sdl_ProjectAutomation_FileBased_FileBasedProject_RunAutomaticTask_System_Guid___System_String_) method to run the task that generates SDLXliff files from translatable source documents. This method requires the file IDs and the task ID—here [ConvertToTranslatableFormat](../../api/projectautomation/Sdl.ProjectAutomation.Core.AutomaticTaskTemplateIds.yml#Sdl_ProjectAutomation_Core_AutomaticTaskTemplateIds_ConvertToTranslatableFormat) as parameters. Apply the conversion only to translatable files—converting a file without a file type definition (such as a reference file) throws an exception. Loop through the source documents and run the convert task only when the [FileRole](../../api/projectautomation/Sdl.ProjectAutomation.Core.FileRole.yml) equals [Translatable](../../api/projectautomation/Sdl.ProjectAutomation.Core.FileRole.yml#fields):
# [C#](#tab/tabid-2)
```cs
@@ -23,12 +22,9 @@ for (int i = 0; i < project.GetSourceLanguageFiles().Length; i++)
AutomaticTask convertTask = project.RunAutomaticTask(
currentFileId,
AutomaticTaskTemplateIds.ConvertToTranslatableFormat);
-
- #region "CopyToTarget"
AutomaticTask copyTask = project.RunAutomaticTask(
currentFileId,
AutomaticTaskTemplateIds.CopyToTargetLanguages);
- #endregion
}
}
```
@@ -56,11 +52,7 @@ The complete function should look as shown below:
///
private void ConvertFiles(FileBasedProject project)
{
- #region "GetFilesForProcessing"
ProjectFile[] files = project.GetSourceLanguageFiles();
- #endregion
-
- #region "RunConversion"
for (int i = 0; i < project.GetSourceLanguageFiles().Length; i++)
{
if (files[i].Role == FileRole.Translatable)
@@ -69,21 +61,16 @@ private void ConvertFiles(FileBasedProject project)
AutomaticTask convertTask = project.RunAutomaticTask(
currentFileId,
AutomaticTaskTemplateIds.ConvertToTranslatableFormat);
-
- #region "CopyToTarget"
AutomaticTask copyTask = project.RunAutomaticTask(
currentFileId,
AutomaticTaskTemplateIds.CopyToTargetLanguages);
- #endregion
}
}
- #endregion
}
```
***
-See Also
---
+## See Also
[Running Tasks on the Project Files](running_tasks_on_project_files.md)
diff --git a/apiconcepts/projectautomation/creating_a_merged_file.md b/apiconcepts/projectautomation/creating_a_merged_file.md
index 3cd1a4fdf4..e809b3d4cf 100644
--- a/apiconcepts/projectautomation/creating_a_merged_file.md
+++ b/apiconcepts/projectautomation/creating_a_merged_file.md
@@ -1,5 +1,4 @@
-Creating a Merged File
-==
+# Creating a Merged File
By default, when you add a native file (e.g. a Microsoft Word document) to a project, a bilingual (SDLXliff) intermediary file will be created from it for further processing, e.g. file analysis, pre-translation, editing, etc. As a general rule, one bilingual file will be created for each native source file per target language.
@@ -46,8 +45,7 @@ project.SetFileRole(files.GetIds(), FileRole.Translatable);
Also note that when you decide to create a merged bilingual file, only this bilingual (SDLXliff) file will exist alongside the original native documents. There will be no individual SDLXliff files, as is the case if you do not create a merged file.
-See Also
---
+## See Also
[Adding Files and Folders](adding_files_and_folders.md)
diff --git a/apiconcepts/projectautomation/creating_a_project_package.md b/apiconcepts/projectautomation/creating_a_project_package.md
index e0438b0673..2b3f92f9f6 100644
--- a/apiconcepts/projectautomation/creating_a_project_package.md
+++ b/apiconcepts/projectautomation/creating_a_project_package.md
@@ -1,10 +1,8 @@
-Creating a Project Package
-==
+# Creating a Project Package
When assigning tasks to e.g. translators and freelancers you will create so-called project packages. These are technically speaking ZIP files that carry the extension **.sdlppx*. Project package files contain the elements of a project that are relevant for a particular translator/editor, i.e. the files to translate or localize (e.g. 3 particular files out of a total of 10), project TMs, reference documents, and potentially also termbase files, AutoSuggest Dictionaries. Through packages you can also split up a project between several translators/editors, e.g. assign the package for the French translation to translator A, the German translation to translator B, or assign only some files to a translator, if one person cannot handle all files for a particular language direction.
-Assign a Manual Task and Create a Project Package
---
+## Assign a Manual Task and Create a Project Package
The screenshot below illustrates how a project package is created from Var:ProductName.
@@ -72,8 +70,7 @@ project.SavePackageAs(projectPackage.PackageId, packageFile);

-Configure the Project Package Options
---
+## Configure the Project Package Options
Apart from the above mentioned parameters there are various other options that you may configure for a project package, e.g. whether or not to include termbases and/or AutoSuggest Dictionaries. The screenshot below shows the project package options that you can set in Var:ProductName:
@@ -142,8 +139,7 @@ return options;
```
***
-Check the Project Package Creation Status
---
+## Check the Project Package Creation Status
It may happen that the package creation fails for some reason (e.g. the project TMs cannot be created, or any files to include in the package have accidentally been deleted or have became corrupted). This is why you should check for any events during the project package creation, and output a message to the user if required.
@@ -181,8 +177,7 @@ if (projectPackage.Status != PackageStatus.Completed)
***
-Putting it All Together
---
+## Putting it All Together
The complete functions should now look as shown below:
@@ -190,24 +185,17 @@ The complete functions should now look as shown below:
```cs
public void CreatePackage(FileBasedProject project, string packageFile)
{
- #region "CreateManualTask"
ProjectFile[] packageFiles = project.GetTargetLanguageFiles(new Language(CultureInfo.GetCultureInfo("de-DE")));
ManualTask newTask = project.CreateManualTask(
"Translate",
"Fred",
DateTime.Now.AddDays(3),
packageFiles.GetIds());
- #endregion
-
- #region "CreateProjectPackage"
ProjectPackageCreation projectPackage = project.CreateProjectPackage(
newTask.Id,
"Sample Package",
"Please hurry up, this is job is urgent!",
this.GetPackageOptions());
- #endregion
-
- #region "PackageStatus"
bool packageIsCreated = false;
while (!packageIsCreated)
{
@@ -234,12 +222,7 @@ public void CreatePackage(FileBasedProject project, string packageFile)
{
throw new Exception("A problem occurred during package creation.");
}
-
- #endregion
-
- #region "SavePackage"
project.SavePackageAs(projectPackage.PackageId, packageFile);
- #endregion
}
```
***
@@ -248,35 +231,20 @@ public void CreatePackage(FileBasedProject project, string packageFile)
```cs
private ProjectPackageCreationOptions GetPackageOptions()
{
- #region "ProjectPackageCreationOptions"
ProjectPackageCreationOptions options = new ProjectPackageCreationOptions();
- #endregion
-
- #region "IncludeRessources"
options.IncludeAutoSuggestDictionaries = false;
options.IncludeMainTranslationMemories = false;
options.RemoveServerBasedTranslationMemories = false;
options.IncludeTermbases = true;
- #endregion
-
- #region "RemoveAutomatedTranslationProviders"
options.RemoveAutomatedTranslationProviders = true;
- #endregion
-
- #region "RecomputeAnalysisStatistics"
options.RecomputeAnalysisStatistics = true;
options.ProjectTranslationMemoryOptions = ProjectTranslationMemoryPackageOptions.CreateNew;
- #endregion
-
- #region "ReturnOptions"
return options;
- #endregion
}
```
***
-See Also
---
+## See Also
[Creating a Return Package](creating_a_return_package.md)
diff --git a/apiconcepts/projectautomation/creating_a_return_package.md b/apiconcepts/projectautomation/creating_a_return_package.md
index bcc7d438c1..6ef1035535 100644
--- a/apiconcepts/projectautomation/creating_a_return_package.md
+++ b/apiconcepts/projectautomation/creating_a_return_package.md
@@ -1,10 +1,8 @@
-Creating a Return Package
-==
+# Creating a Return Package
After translators/editors have fully processed the files contained in a project package (see [Creating a Project Package](creating_a_project_package.md)), they send them back in a so-called return package. Similar to a project package, a return package is technically a ZIP file that have the extension **.sdlrpx*. Return packages are usually a lot smaller than project packages, as they contain only the compressed bilingual (SDLXliff) files, i.e. no project TMs, reference files, or any other resources. For this reason, when you create a return package programmatically there are far less options available to configure.
-Create a Return Package Programmatically
---
+## Create a Return Package Programmatically
In the sample implementation below we use a function called ```CreatePackage```, which takes a [FileBasedProject](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml) object as parameter. First, select the files that need to be included in the return package. It is possible that the original project package on which the return package is based contained several target languages, e.g. when the project package was sent to a translator or agency who can handle more than one target language. However, let us assume for the following example that there is only one target language involved, e.g. German (*de-DE*) and that all files of that target language should be returned. Use the [CultureInfo](https://docs.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo?redirectedfrom=MSDN&view=net-5.0) class to create a new Language object.
Next, apply the [GetTargetLanguageFiles](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml#Sdl_ProjectAutomation_FileBased_FileBasedProject_GetTargetLanguageFiles) method to the project to retrieve the target files for the selected language and to create a [ProjectFile](../../api/projectautomation/Sdl.ProjectAutomation.Core.ProjectFile.yml) array. Since the [GetTargetLanguageFiles](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml#Sdl_ProjectAutomation_FileBased_FileBasedProject_GetTargetLanguageFiles) method, which we are going to apply later requires, the file ids as parameter, apply the ```GetIds``` method to create a ```Guid``` array, which contains the project file ids:
@@ -39,8 +37,7 @@ project.SavePackageAs(returnPackage.PackageId, @"c\temp\return_package.sdlrpx");
Note that a return package may also contain only some of the files from the original project package. For example, a translator may have to return the first two out of five files earlier, because they have become more urgent. In that case you can programmatically create the package with only some of the target files by specifying the corresponding file ids during project creation.
-Check the Return Package Creation Status
---
+## Check the Return Package Creation Status
It may happen that the package creation fails for some reason (e.g. any files to include in the package have accidentally been deleted or have become corrupted). This is why you should check for any events during the project package creation, and output a message to the user if required.
The following sample code leverages the [PackageStatus](../../api/projectautomation/Sdl.ProjectAutomation.Core.PackageStatus.yml) class to check the project package status. It throws an error message if in the end the package status is not [Completed](../../api/projectautomation/Sdl.ProjectAutomation.Core.PackageStatus.yml#fields):
@@ -76,8 +73,7 @@ if (returnPackage.Status != PackageStatus.Completed)
```
***
-Putting it All Together
---
+## Putting it All Together
The complete function should now look as shown below:
@@ -85,17 +81,10 @@ The complete function should now look as shown below:
```cs
public void CreatePackage(FileBasedProject project)
{
- #region "FileIds"
Language targetLang = new Language(CultureInfo.GetCultureInfo("de-DE"));
ProjectFile[] files = project.GetTargetLanguageFiles(targetLang);
Guid[] fileIds = files.GetIds();
- #endregion
-
- #region "ReturnPackage"
ReturnPackageCreation returnPackage = project.CreateReturnPackage(fileIds, "Return Package Name", "Comment: Everything went fine");
- #endregion
-
- #region "PackageStatus"
bool packageIsCreated = false;
while (!packageIsCreated)
{
@@ -122,17 +111,12 @@ public void CreatePackage(FileBasedProject project)
{
throw new Exception("A problem occurred during package creation.");
}
- #endregion
-
- #region "SavePackage"
project.SavePackageAs(returnPackage.PackageId, @"c\temp\return_package.sdlrpx");
- #endregion
}
```
***
-See Also
---
+## See Also
[Creating a Project Package](creating_a_project_package.md)
diff --git a/apiconcepts/projectautomation/creating_proj_based_on_templates.md b/apiconcepts/projectautomation/creating_proj_based_on_templates.md
index 28e4218412..1a2b7d01e3 100644
--- a/apiconcepts/projectautomation/creating_proj_based_on_templates.md
+++ b/apiconcepts/projectautomation/creating_proj_based_on_templates.md
@@ -1,12 +1,10 @@
-Creating Projects Based on Templates
-==
+# Creating Projects Based on Templates
The creation of new projects can further be streamlined through the use of project templates. This is somewhat similar to leveraging reference projects (see [Creating Projects Based on Previous Projects](creating_project_based_on_prev_proj.md)). However, in this case you do not use an **.sdlproj* file, but an **.sdltlp* template file, which contains settings such as the selection of TMs (i.e. the translation provider configuration), termbases, task settings, source / target languages, etc.
While reference projects are mainly used when you need to handle update projects based on previous projects, project templates help streamline the creation of multiple similar projects, e.g. when a customer requires a specific project structure.
-Create a Project Programmatically Based on a Template
---
+## Create a Project Programmatically Based on a Template
Start by implementing a function called ```CreateBasedOnTemplate```. Use the [ProjectTemplateReference](../../api/projectautomation/Sdl.ProjectAutomation.Core.ProjectTemplateReference.yml) class to create a project template object. For this, you just need to provide the full name and path of the **.sdltpl* project template file:
@@ -44,8 +42,7 @@ return info;
```
***
-Putting it All Together
---
+## Putting it All Together
The two complete functions should now look as shown below:
@@ -53,15 +50,10 @@ The two complete functions should now look as shown below:
```cs
public void CreateBasedOnTemplate()
{
- #region "GetTemplate"
string templateFile = @"c:\temp\project_template.sdltpl";
ProjectTemplateReference template = new ProjectTemplateReference(templateFile);
- #endregion
-
- #region "TemplateBasedProject"
FileBasedProject newProject = new FileBasedProject(this.GetInfoForTemplateProject(), template);
newProject.Save();
- #endregion
}
```
***
@@ -70,7 +62,6 @@ public void CreateBasedOnTemplate()
```cs
public ProjectInfo GetInfoForTemplateProject()
{
- #region "TemplateProjectInfo"
ProjectInfo info = new ProjectInfo();
info.Name = "Project based on Template";
@@ -84,13 +75,11 @@ public ProjectInfo GetInfoForTemplateProject()
info.LocalProjectFolder = localProjectFolder;
return info;
- #endregion
}
```
***
-See Also
---
+## See Also
[Setting the Project Information](setting_the_project_information.md)
[Configuring the Project Properties](configuring_the_project_properties.md)
diff --git a/apiconcepts/projectautomation/creating_project_based_on_prev_proj.md b/apiconcepts/projectautomation/creating_project_based_on_prev_proj.md
index 9fbe6d7498..b0b882149b 100644
--- a/apiconcepts/projectautomation/creating_project_based_on_prev_proj.md
+++ b/apiconcepts/projectautomation/creating_project_based_on_prev_proj.md
@@ -1,12 +1,10 @@
-Creating Projects Based on Previous Projects
-==
+# Creating Projects Based on Previous Projects
Var:ProductName allows you to create new projects based on previous projects. That way you can leverage the settings that were used in the previous project such as the language pairs, the task settings, the TM and termbase selection, etc.
Example: Suppose that last year you have processed a project called "Spelling Checker 1.0". This year, you need to localize the documentation for version 2.0 of the product. In such a case, it makes sense to create the new project based on the previous project, thereby re-using the settings that exist in the previous project. Only the updated source files then need to be selected, the remaining parameters (except the due date) can usually stay as is. However, of course, you can change any of the existing parameters, e.g. add a new language direction, if the updated product needs to be distributed in a new market. The **New Project** wizard of Var:ProductName allows you to select a previous project from a dropdown list. Your API-based application could be made, for example, to select the **.sdlproj* file of the previous project to accelerate the project creation.
-Create an Update Project Programmatically
---
+## Create an Update Project Programmatically
Implement a function called ```CreateBasedOnPreviousProject```. Leverage the [ProjectReference](../../api/projectautomation/Sdl.ProjectAutomation.Core.ProjectReference.yml) class to create a reference project object, which holds the previous project that our new (update) project should be based upon. When creating the reference project object provide the **.sdlproj* file name and path as string parameter:
@@ -54,8 +52,7 @@ return info;
Note that the updated source files to translate would also have to be added to the update project, as these will not be taken over from the previous (reference) project. For an example of how to add files to a project see [Adding Files and Folders](adding_files_and_folders.md).
-Putting it All Together
---
+## Putting it All Together
The complete function should look as shown below:
@@ -63,16 +60,11 @@ The complete function should look as shown below:
```cs
public void CreateBasedOnPreviousProject()
{
- #region "RefProject"
string refProjFile = @"C:\temp\RefProject.sdlproj";
ProjectReference refProject = new ProjectReference(refProjFile);
- #endregion
-
- #region "UpdateProject"
FileBasedProject updateProject = new FileBasedProject(this.GetUpdateProjectInfo(), refProject);
updateProject.Save();
- #endregion
}
```
***
@@ -81,7 +73,6 @@ public void CreateBasedOnPreviousProject()
```cs
public ProjectInfo GetUpdateProjectInfo()
{
- #region "UpdateProjectInfo"
ProjectInfo info = new ProjectInfo();
info.Name = "My update project";
@@ -96,13 +87,11 @@ public ProjectInfo GetUpdateProjectInfo()
info.LocalProjectFolder = localProjectFolder;
return info;
- #endregion
}
```
***
-See Also
---
+## See Also
[Setting the Project Information](setting_the_project_information.md)
diff --git a/apiconcepts/projectautomation/deleting_projects.md b/apiconcepts/projectautomation/deleting_projects.md
index 4d6c2e5c13..4872b77c94 100644
--- a/apiconcepts/projectautomation/deleting_projects.md
+++ b/apiconcepts/projectautomation/deleting_projects.md
@@ -1,5 +1,4 @@
-Deleting Projects
-==
+# Deleting Projects
Projects can take a lot of hard disk space, as they are comprised of a number of folders, sub-folders, which contain source and target documents, project termbases, etc. By applying a simple delete you can physically remove a project and all of its files.
@@ -14,8 +13,7 @@ project.Delete();
Note that this will delete all project files and folders including the **.sdlproj* file, so this is a potentially dangerous operation that you should carry out only if you are sure that no productive data gets lost. You could use this method, for example, when you create projects only temporarily, e.g. for the sake of generating a report. After the report has been generated, you could remove the project files, so that they no longer clutter the hard-disk unnecessarily.
-See Also
---
+## See Also
[Setting the Project Information](setting_the_project_information.md)
[Deleting the Project](deleting_the_project.md)
diff --git a/apiconcepts/projectautomation/deleting_the_project.md b/apiconcepts/projectautomation/deleting_the_project.md
index 62b57af213..8fc050df2f 100644
--- a/apiconcepts/projectautomation/deleting_the_project.md
+++ b/apiconcepts/projectautomation/deleting_the_project.md
@@ -1,5 +1,4 @@
-Deleting the Project
-==
+# Deleting the Project
After the reports have been generated, the application should 'clean up after itself', i.e. it should remove all project files, so that it can be run multiple times without causing exceptions due to an already existing folder and without cluttering the hard disk. The user can, however, set a command-line parameter to keep the project files if e.g. it can be assumed that the project will go ahead anyway. In this case, the project files will be required for generating project packages to send out to translators and editors.
@@ -14,6 +13,5 @@ if (!keepProjectFiles)
```
***
-See Also
---
+## See Also
[Deleting Projects](deleting_projects.md)
diff --git a/apiconcepts/projectautomation/downloading_and_uploading_files.md b/apiconcepts/projectautomation/downloading_and_uploading_files.md
index 3859aff826..5bab6e8864 100644
--- a/apiconcepts/projectautomation/downloading_and_uploading_files.md
+++ b/apiconcepts/projectautomation/downloading_and_uploading_files.md
@@ -1,10 +1,8 @@
-Downloading and Uploading Files
-==
+# Downloading and Uploading Files
Files must be copied to the local copy to be edited and copied back to the server so they are available to other users
-Get the latest version of a file from the project server
---
+## Get the latest version of a file from the project server
Use the ```DownloadLatestVersion``` method in a [FileBasedProject](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml) to get the latest version of a file from the server and copy it to your local copy.
@@ -66,8 +64,7 @@ void DownloadAllLatest(FileBasedProject project, Guid[] fileIds, bool overrideWo
```
***
-List all versions of a file on the project server
---
+## List all versions of a file on the project server
When a file is uploaded to the server a new version of the file is created. The server stores all these versions allowing you to examine and download previous versions.
@@ -92,8 +89,7 @@ private void ShowServerFileHistory(FileBasedProject project, Guid fileId)
```
***
-Get a previous version of a file from the project server
---
+## Get a previous version of a file from the project server
Downloading a specific version of a file allows you to save a specific file version locally. You may want to download a specific version of a file so that you can compare it to a current version.
@@ -115,8 +111,7 @@ project.DownloadSpecificServerVersion(fileId, 1, @"c:\files", (obj, evt) =>
```
***
-Uploading a file to the server
---
+## Uploading a file to the server
When you use the [CheckinFiles](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml#Sdl_ProjectAutomation_FileBased_FileBasedProject_CheckinFiles_System_Guid___System_String_System_EventHandler_Sdl_ProjectAutomation_Core_ProgressEventArgs__) method this will automatically upload the files to the server. This method provides an event delegate so that you can report on the progress of the upload and cancel the upload if required.
@@ -137,8 +132,7 @@ project.CheckinFiles(fileIds, "This is where you add a check in comment",
```
***
-See Also
---
+## See Also
[About Server Based Projects](about_server_based_projects.md)
[Connecting a Project to a Project Server](connecting_a_project_to_a_project_server.md)
diff --git a/apiconcepts/projectautomation/examples_general.md b/apiconcepts/projectautomation/examples_general.md
index f7b19ddcb8..8efb03cbf9 100644
--- a/apiconcepts/projectautomation/examples_general.md
+++ b/apiconcepts/projectautomation/examples_general.md
@@ -1,5 +1,4 @@
-Code Examples
-==
+# Code Examples
The following chapters provide practical examples of how to use the Project Automation API based on short, easy-to-understand code snippets.
# Use Cases Overview
diff --git a/apiconcepts/projectautomation/general.md b/apiconcepts/projectautomation/general.md
index e9f3231976..4309c02566 100644
--- a/apiconcepts/projectautomation/general.md
+++ b/apiconcepts/projectautomation/general.md
@@ -1,22 +1,19 @@
-Overview
-=====
-This part of the help system explains what a localization project is and how the Project Automation API supports localization projects.
+# Overview
+This section explains what a localization project is and how the Project Automation API supports it.
-Localization Projects
------
-We define a localization project as the data, resources and process required to localize a set of source documents in a given language (i.e. the source language) into one or more target languages. As one would expect, a large part of this work will be accomplished using RWS's localization tools, primarily it's File Processing, the Translation Memory and Terminology tools. However, beyond these low-level tools and components, there is a need for a higher-level framework or environment, which models localization projects in their entirety and which provides an easy way to use the variety of localization tools through standard, recommended workflows, following best practices. Indeed, at it's core, a lot of what the Project Automation API provides revolves around automated processing of source documents using RWS's localization tools.
+## Localization Projects
+A localization project encompasses the data, resources, and processes required to localize source documents from a given language (the source language) into one or more target languages. As one would expect, a large part of this work will be accomplished using RWS's localization tools, primarily it's File Processing, the Translation Memory and Terminology tools. Beyond these low-level components, a higher-level framework is needed—one that models localization projects in their entirety and provides access to localization tools through standard, recommended workflows following best practices. At its core, the Project Automation API revolves around automated processing of source documents using RWS's localization tools.
A typical localization project consists of a preparation phase upfront, in which files are prepared for translation. This process can usually be automated to a large extent. However, some of it will require manual work, for instance when it comes to dealing with unexpected or faulty file formats or content. The main result of the preparation process are the prepared files, but there will also be important scoping information about the project, such as the number of words there are to translate, which part of the translation has been leveraged from previous translation or translation memories. This information, commonly referred to as the "analysis report" then feeds into project planning, resourcing and customer billing.
The preparation phase is followed by a number of manual steps, i.e. mainly the translation of the files itself and review of that translation. Finally, after review, the translated files are prepared for delivery to the customer. Again, this is a process that can be largely automated, but which for certain file formats requires manual work, for example, DTP work on Adobe FrameMaker or InDesign files.
-Real-life localization projects are notorious for their variety. They rarely follow standard workflows, and every customer and project will present their own challenges, which is due to customer requirements, differences in file formats, and different working practices that have evolved historically. The Project Automation API aims at providing a way to deal with these variations, through its configuration and extensibility options.
+Real-life localization projects vary widely. They rarely follow standard workflows—customer requirements, file format differences, and historically evolved practices all introduce unique challenges. The Project Automation API addresses these variations through its configuration and extensibility options.
-Another aspect is the integration into external systems. The Project Automation API also aims at providing various ways to integrate with external systems, such as content management systems, CRM systems, workflow systems, etc.
+The Project Automation API also supports integration with external systems such as content management systems, CRM systems, and workflow systems.
-Basic Project Automation API Concepts
-------
-This section of the help system focuses on explaining how the Project Automation API models localization projects. Throughout this section you will find references to how to this is done. The following topics will be covered:
+## Basic Project Automation API Concepts
+This section focuses on how the Project Automation API models localization projects. The following topics are covered:
* [About Projects](about_projects.md): High-level overview of a project in the Project Automation API sense.
* [About Project Files](about_project_files.md): Overview of how various types of files are modeled in a project.
diff --git a/apiconcepts/projectautomation/generating_and_exporting_target_files.md b/apiconcepts/projectautomation/generating_and_exporting_target_files.md
index 1a4fc94b98..30e61ef0ee 100644
--- a/apiconcepts/projectautomation/generating_and_exporting_target_files.md
+++ b/apiconcepts/projectautomation/generating_and_exporting_target_files.md
@@ -1,5 +1,4 @@
-Generating and Exporting Target Files
-==
+# Generating and Exporting Target Files
At the end of a project lifecycle you will usually generate the native file formats from the bilingual (SDLXliff) documents. In addition you may want to copy the native target files to a specified location for delivery to the end customer. This is accomplished with two automatic tasks, i.e. the generation of the native document format and exporting the finalized files to a specific folder.
@@ -48,8 +47,7 @@ project.UpdateSettings(settings);
```
***
-Putting it All Together
---
+## Putting it All Together
The complete function should look as shown below:
@@ -57,28 +55,16 @@ The complete function should look as shown below:
```CS
public void GetExportTaskSettings(FileBasedProject project)
{
- #region "ExportTaskSettings"
ISettingsBundle settings = project.GetSettings();
ExportFilesSettings exportTaskSettings = settings.GetSettingsGroup();
- #endregion
-
- #region "ExportLocation"
exportTaskSettings.ExportLocation.Value = @"c:\temp";
- #endregion
-
- #region "ExportFileVersion"
exportTaskSettings.ExportFileVersion.Value = ExportFileVersion.Bilingual;
- #endregion
-
- #region "UpdateSettings"
project.UpdateSettings(settings);
- #endregion
}
```
***
-See Also
---
+## See Also
[Analyze Files Settings](analyze_files_settings.md)
[Project TM Creation Settings](project_tm_creation_settings.md)
diff --git a/apiconcepts/projectautomation/generating_the_task_report.md b/apiconcepts/projectautomation/generating_the_task_report.md
index cf5070dd33..e190cc7969 100644
--- a/apiconcepts/projectautomation/generating_the_task_report.md
+++ b/apiconcepts/projectautomation/generating_the_task_report.md
@@ -1,5 +1,4 @@
-Generating the Task Report
-==
+# Generating the Task Report
This chapter explains how to retrieve the actual task result, which is the analyze files report. There are two ways of generating a task report, an easy way, and a 'hard' way:
@@ -38,8 +37,7 @@ project.SaveTaskReportAs(this.reportId, path + "/AnalyzeTaskReport.xls", ReportF
```
***
-Create the Custom Report Output
---
+## Create the Custom Report Output
Creating a custom output is a bit more challenging. It requires us to retrieve the segment, word, character, etc. count through various properties and integrate this information in custom format, which in our implementation is a simple console output.
@@ -110,8 +108,7 @@ for (int i = 0; i < analysisStats.Fuzzy.Length; i++)
For the full implementation see the section below:
-Putting it All Together
---
+## Putting it All Together
The complete function for creating the reports should look as shown below:
@@ -123,17 +120,10 @@ The complete function for creating the reports should look as shown below:
///
private void CreateReports(FileBasedProject project, string path)
{
- #region "CreateStandardReport"
project.SaveTaskReportAs(this.reportId, path + "/AnalyzeTaskReport.xls", ReportFormat.Excel);
- #endregion
-
- #region "Statistics"
ProjectStatistics projectStats = project.GetProjectStatistics();
TargetLanguageStatistics[] targetStats = projectStats.TargetLanguageStatistics;
AnalysisStatistics analysisStats = targetStats[0].AnalysisStatistics;
- #endregion
-
- #region "WriteData"
string result = "Analysis result for all files:\n\n";
result += "\nPerfect matches\n";
@@ -149,17 +139,12 @@ private void CreateReports(FileBasedProject project, string path)
result += "Characters: " + analysisStats.InContextExact.Characters.ToString() + "\n";
result += "Tags: " + analysisStats.InContextExact.Tags.ToString() + "\n";
result += "Placeables: " + analysisStats.InContextExact.Placeables.ToString() + "\n";
-
- #region "Exact"
result += "\nExact matches\n";
result += "Segments: " + analysisStats.Exact.Segments.ToString() + "\n";
result += "Words: " + analysisStats.Exact.Words.ToString() + "\n";
result += "Characters: " + analysisStats.Exact.Characters.ToString() + "\n";
result += "Tags: " + analysisStats.Exact.Tags.ToString() + "\n";
result += "Placeables: " + analysisStats.Exact.Placeables.ToString() + "\n";
- #endregion
-
- #region "Fuzzy"
for (int i = 0; i < analysisStats.Fuzzy.Length; i++)
{
string rangeMax = analysisStats.Fuzzy[i].Band.MaximumMatchValue.ToString();
@@ -172,8 +157,6 @@ private void CreateReports(FileBasedProject project, string path)
result += "Tags: " + analysisStats.Fuzzy[i].Tags.ToString() + "\n";
result += "Placeables: " + analysisStats.Fuzzy[i].Placeables.ToString() + "\n";
}
- #endregion
-
result += "\nRepetitions\n";
result += "Segments: " + analysisStats.Repetitions.Segments.ToString() + "\n";
result += "Words: " + analysisStats.Repetitions.Words.ToString() + "\n";
@@ -196,14 +179,11 @@ private void CreateReports(FileBasedProject project, string path)
result += "Placeables: " + analysisStats.Total.Placeables.ToString() + "\n";
Console.Write(result);
-
- #endregion
}
```
***
-See Also
---
+## See Also
[Retrieving the Project Statistics](retrieving_the_project_statistics.md)
[Saving Task Reports](saving_task_reports.md)
diff --git a/apiconcepts/projectautomation/importing_a_return_package.md b/apiconcepts/projectautomation/importing_a_return_package.md
index 454cdb7893..aa48b037af 100644
--- a/apiconcepts/projectautomation/importing_a_return_package.md
+++ b/apiconcepts/projectautomation/importing_a_return_package.md
@@ -1,10 +1,8 @@
-Importing a Return Package
-==
+# Importing a Return Package
After the return package (see [Creating a Return Package](creating_a_return_package.md)) has been sent back to the project manager, e.g. via e-mail, he/she opens it in Var:ProductName. This basically means that the package content is extracted, and the translated, edited, or proofread bilingual (SDLXliff) document overwrite the previous (e.g. untranslated) files, thus updating the project on the project manager's side.
-Import a Return Package Programmatically
---
+## Import a Return Package Programmatically
Implementing a function called ```OpenPackage```, which takes the project file name (i.e. the name and path of the **.sdlproj* file) and the name and path of the return package (i.e. the **.sdlrpx* file) as string parameters.
@@ -40,8 +38,7 @@ ReturnPackageImport import = project.ImportReturnPackage(returnPackageFile);
>
>Once a return package has been imported, it cannot be imported again. If you try to re-import the same return package, an exception will be thrown.
-Check the Import Status
---
+## Check the Import Status
It may happen that the return extraction and import fails for some reason (e.g. a project file has accidentally been set to read-only and thus cannot be overwritten and updated by a file in the return package). This is why you should check for the import status, and output a message to the user if required. The following sample code leverages the [PackageStatus](../../api/projectautomation/Sdl.ProjectAutomation.Core.PackageStatus.yml) class to check the project package status. It throws an error message if in the end the package status is not [Completed](../../api/projectautomation/Sdl.ProjectAutomation.Core.PackageStatus.yml#fields):
@@ -77,8 +74,7 @@ if (import.Status != PackageStatus.Completed)
***
-Putting it All Together
---
+## Putting it All Together
The complete function should now look as shown below:
@@ -86,20 +82,10 @@ The complete function should now look as shown below:
```cs
public void OpenPackage(string projectFile, string returnPackageFile)
{
- #region "EventArgs"
List taskStatusEventArgsList = new List();
List messageEventArgsList = new List();
- #endregion
-
- #region "OpenProject"
FileBasedProject project = new FileBasedProject(projectFile);
- #endregion
-
- #region "ImportPackage"
ReturnPackageImport import = project.ImportReturnPackage(returnPackageFile);
- #endregion
-
- #region "CheckImportStatus"
bool packageIsImported = false;
while (!packageIsImported)
{
@@ -126,13 +112,11 @@ public void OpenPackage(string projectFile, string returnPackageFile)
{
throw new Exception("A problem occurred during package import.");
}
- #endregion
}
```
***
-See Also
---
+## See Also
[Creating a Return Package](creating_a_return_package.md)
[About Packages](about_packages.md)
diff --git a/apiconcepts/projectautomation/introduction_to_the_sample_app.md b/apiconcepts/projectautomation/introduction_to_the_sample_app.md
index 81834b40b8..25190fcabd 100644
--- a/apiconcepts/projectautomation/introduction_to_the_sample_app.md
+++ b/apiconcepts/projectautomation/introduction_to_the_sample_app.md
@@ -1,5 +1,4 @@
-Introduction to the Sample Application
-==
+# Introduction to the Sample Application
This chapter will walk you step by step through the creation of a command-line sample application that leverages the Project Automation API.
@@ -23,8 +22,7 @@ At runtime, the user needs to be able to provide the following parameters:
The application to develop within the scope of the sample project constitutes a realistic use case. For comprehensive projects a large number of files usually needs to be processed in some ways. With a command-line application you can effectively automate such tasks, which can also be run as a scheduled process.
-See Also
---
+## See Also
[Setting up the Visual Studio Project](setting_up_the_visual_studio_project.md)
[Configuring the Project Properties](configuring_the_project_properties.md)
diff --git a/apiconcepts/projectautomation/overview.md b/apiconcepts/projectautomation/overview.md
index 39360417e3..b20c44d65a 100644
--- a/apiconcepts/projectautomation/overview.md
+++ b/apiconcepts/projectautomation/overview.md
@@ -1,11 +1,9 @@
-Introduction
-=====
-This documentation provides practical examples of how to use the Project Automation API, which allows programmatic access to the project automation functionality of Var:ProductName. Apart from various code snippets that demonstrate common use cases, you will also find a fully-documented command-line sample application that showcases how to automate project creation and batch task functionality.
+# Introduction
+This documentation demonstrates how to use the Project Automation API, which provides programmatic access to the project automation functionality of Var:ProductName. In addition to code snippets covering common use cases, a fully-documented command-line sample application demonstrates how to automate project creation and batch tasks.
-What you can do with this SDK
-----
-The Project Automation API is concerned with the automation of common project management tasks such as file analysis, pre-translation, generation of finalized target documents, etc. Based on this API you could potentially build fully-fledged, customized workflow systems. Below you can find examples of applications for the API:
+## What you can do with this SDK
+The Project Automation API automates common project management tasks: file analysis, pre-translation, generation of finalized target documents, and more. You can build fully-fledged, customized workflow systems on top of it. Example applications include:
* Developing a Command-line application that traverses a folder / sub-folder structure to analyze or pre-translate the translatable documents contained therein.
diff --git a/apiconcepts/projectautomation/perfect_match.md b/apiconcepts/projectautomation/perfect_match.md
index 60f7feaa31..025b700436 100644
--- a/apiconcepts/projectautomation/perfect_match.md
+++ b/apiconcepts/projectautomation/perfect_match.md
@@ -1,11 +1,9 @@
-Perfect Match
-==
+# Perfect Match
The Perfect Match batch task copies pre-translated segments from previous versions of your files into the current project files. This chapter provides information on the settings that you can configure for this task and the parameters required to locate any previous file versions.
-Configuring the Task Settings
---
+## Configuring the Task Settings
The screenshot below shows the settings that can be configured for the Perfect Match task in Var:ProductName.
@@ -42,8 +40,7 @@ project.UpdateSettings(settings);
```
***
-Putting it All Together
---
+## Putting it All Together
The function should look as shown below:
@@ -51,20 +48,10 @@ The function should look as shown below:
```CS
public void GetPerfectMatchTaskSettings(FileBasedProject project)
{
- #region "PerfectMatchTaskSettings"
ISettingsBundle settings = project.GetSettings();
PerfectMatchTaskSettings perfectMatchSettings = settings.GetSettingsGroup();
- #endregion
-
- #region "MarkAsPerfectMatchAndLock"
-
perfectMatchSettings.MarkAsPerfectMatchAndLock.Value = true;
- #endregion
-
-
- #region "UpdateTaskSettings"
project.UpdateSettings(settings);
- #endregion
}
```
***
@@ -73,8 +60,7 @@ public void GetPerfectMatchTaskSettings(FileBasedProject project)

-Mapping Previous Bilingual Files to Project Files
---
+## Mapping Previous Bilingual Files to Project Files
For Perfect Match to work the files in your project must each hold a reference to a previous bilingual file The ```IProject``` interface contains a number of methods for assigning and removing these association to and from your project files.
@@ -173,8 +159,7 @@ project.AddBilingualReferenceFile(new BilingualFileMapping(FileIdFromOriginalSou
```
***
-Calling Perfect Match as a Single Task
---
+## Calling Perfect Match as a Single Task
After you have prepared a project and run the ```CopyToTargetLanguages``` task the target language files are available and you can assign bilingual reference files directly to the target files to be used in Perfect Match.
@@ -196,8 +181,7 @@ AutomaticTaskTemplateIds.PerfectMatch);
```
***
-Calling Perfect Match as Part of a Task Sequence
---
+## Calling Perfect Match as Part of a Task Sequence
Perfect Match can be run as part of a batch task sequence and is included in the standard prepare sequence. Before you prepare the project you do not have access to the source or target bilingual files however the [AddBilingualReferenceFiles](../../api/projectautomation/Sdl.ProjectAutomation.Core.IProject.yml#Sdl_ProjectAutomation_Core_IProject_AddBilingualReferenceFiles_Sdl_ProjectAutomation_Core_BilingualFileMapping___) methods will accept the original documents as parameters.
@@ -228,8 +212,7 @@ public void RunPrepareWithPerfectMatch()
```
***
-See Also
---
+## See Also
[Analyze Files Settings](analyze_files_settings.md)
[Project TM Creation Settings](project_tm_creation_settings.md)
diff --git a/apiconcepts/projectautomation/pre_translate_settings.md b/apiconcepts/projectautomation/pre_translate_settings.md
index 4f44bc3543..c8fc22bc52 100644
--- a/apiconcepts/projectautomation/pre_translate_settings.md
+++ b/apiconcepts/projectautomation/pre_translate_settings.md
@@ -1,5 +1,4 @@
-Pre-translate Settings
-==
+# Pre-translate Settings
When matches for a given document are found in one or several TMs, you may want the target segments for all matching segments to be inserted automatically in one go, rather than having to insert the translations manually in the editor. This is what the pre-translate batch task does. This chapter provides information on the settings that you can configure for this task.
@@ -88,8 +87,7 @@ project.UpdateSettings(settings);
```
***
-Putting it All Together
---
+## Putting it All Together
The function should look as shown below:
@@ -97,42 +95,21 @@ The function should look as shown below:
```CS
public void GetPretranslateTaskSettings(FileBasedProject project)
{
- #region "PetranslateTaskSettings"
ISettingsBundle settings = project.GetSettings();
TranslateTaskSettings pretranslateSettings = settings.GetSettingsGroup();
- #endregion
-
- #region "MinimumScore"
pretranslateSettings.MinimumMatchScore.Value = 95;
- #endregion
-
- #region "ExactMatches"
pretranslateSettings.ConfirmAfterApplyingExactMatch.Value = true;
pretranslateSettings.LockExactMatchSegments.Value = false;
- #endregion
-
- #region "ContextMatches"
pretranslateSettings.ConfirmAfterApplyingInContextExactMatch.Value = true;
pretranslateSettings.LockContextMatchSegments.Value = true;
- #endregion
-
- #region "NoMatch"
pretranslateSettings.NoTranslationMemoryMatchFoundAction.Value = NoTranslationMemoryMatchFoundAction.CopySourceToTarget;
- #endregion
-
- #region "TranslationOverwrite"
pretranslateSettings.TranslationOverwriteMode.Value = TranslationUpdateMode.OverwriteExistingTranslation;
- #endregion
-
- #region "UpdateTaskSettings"
project.UpdateSettings(settings);
- #endregion
}
```
***
-See Also
---
+## See Also
[Analyze Files Settings](analyze_files_settings.md)
[Project TM Creation Settings](project_tm_creation_settings.md)
diff --git a/apiconcepts/projectautomation/project_configuration.md b/apiconcepts/projectautomation/project_configuration.md
index e57ec8ad5f..615d858fb3 100644
--- a/apiconcepts/projectautomation/project_configuration.md
+++ b/apiconcepts/projectautomation/project_configuration.md
@@ -1,10 +1,8 @@
-Project Configuration
-====
-This section describes what is included in the configuration of a project and explains how project templates can help with management of configuration information.
+# Project Configuration
+This section describes project configuration and explains how project templates simplify configuration management.
-Project Configuration
-----
-Some configuration is required in order to process a localization project. Various parts of the system, be it automatic tasks or manual tasks, can be configured to work in various ways depending on the type of input files, the customer for whom the project is done, the languages or other factors. We refer to this as the Project Configuration.
+## Project Configuration
+Processing a localization project requires configuration. Both automatic and manual tasks adapt their behavior based on input file types, customer requirements, languages, and other factors. This collective setup is the Project Configuration.
The project configuration consists of the following:
@@ -24,8 +22,7 @@ The project configuration consists of the following:
A project configuration is represented by the `IProjectConfiguration` interface in the object model.
-Project Settings
----
+## Project Settings
The project settings are settings that are defined for the project as a whole. They use the standard settings mechanism. The project settings can be overridden for individual language directions (see Language direction specific settings).
By default, a number of settings groups are provided to configure some standard tasks in the system:
@@ -43,14 +40,12 @@ The generic nature of the settings mechanism makes it a natural way for custom c
Most of these settings can be overridden on a language direction level, that is if the particular settings makes sense in a target language context and if the particular components consuming the settings expect this to happen. See [Language direction specific settings](#language-directions).
-Language Directions
------
+## Language Directions
The project configuration contains a number of language directions (= source-target language combinations), which determine from which source language into which target languages the files should be translated.
A language direction is represented by the `ILanguageDirection` interface in the object model.
-Translation Providers
-----
+## Translation Providers
Every language direction has the ability to contain a list of translation providers. A translation provider is an abstract concept of an engine or data source that can provide translations or translation suggestions for a segment and optionally has concordance search capabilities. The following types of translation providers are currently supported:
* Translation Memory (file- or server-based): the RWS translation memory engine.
@@ -70,12 +65,10 @@ An AutoSuggest dictionary is represented by the `IAutoSuggestDictionary` interfa
The user can override individual [Project settings](#project-settings) for a specific language direction. For instance, if the project-level minimum translation memory match value is 80%, this can be overridden for a specific language direction to be 90%. All other language directions still inherit the project-level value. Also, all other settings for this language direction, except for the minimum match value, will still be inherited from the project settings.
-File Type Configuration
-------
+## File Type Configuration
The project configuration contains an ordered list of file types available for the project. A file type, sometimes called file type definition, is essentially a collection of settings that influence various aspects of processing translatable files, such as extracting translatable content, preview, special characters and tags that be used while editing the file, etc. The File Type Support Framework provides a mechanism for automatically selecting a matching file type for a given file, but it is possible that for a given file, there are multiple matching file types. By only including certain file types in the project, and by prioritizing these (the first matching file type in the list will be used), the user can get a certain level of control over which file type will be used for processing the files in a project.
-Language Resources
-------
+## Language Resources
"Language Resources"" is an umbrella term for settings that affect language-specific processing. The main example of this in use currently is segmentation and tokenization. The following types of language resources are currently available:
1. **Segmentation rules**: These rules determine how translatable content is split into segments, which represent the smallest piece of content that can be translated as a unit. The rules are obviously language specific.
@@ -90,14 +83,12 @@ Note that language resources are specified on the project level, rather than the
For more information about language resources, please refer to the Translation Memory API documentation.
-Termbases
------
+## Termbases
The project can also optionally contain references to one or more termbases that should be used during translation to identify and translate well-known terminology. One of the termbases in the list should be marked as the default termbase. The default termbase is always the termbase that will be searched for matches first. Part of the termbase configuration is also a mapping from project language to termbase indexes, to make sure that the appropriate indexes are used for searching for terminology in the various project languages. For every termbase, a filter can be specified as well; this determines the content of the termbase that should searched within the context of this project.
Termbases can either be file-based or server-based. MultiTerm imposes the limitation that when links to server-based termbases are included in a project, they all have to reside on the same termbase server, since it cannot perform cross-server termbase searches.
-Analysis Bands
------
+## Analysis Bands
Analysis bands are the categories in which word, segment and character count statistics are calculated during translation memory analysis as part of project preparation. During that analysis, a translation memory lookup is performed for every segment in a translatable file. The best match returned by the translation memory is then categorized according to the analysis bands. The default categories are:
* Context match: A 100% match, for which the context (preceding segment) matches the current context in the document.
@@ -111,22 +102,19 @@ Analysis bands are the categories in which word, segment and character count sta
All of the above categories are fixed, expect for the fuzzy analysis bands. The fuzzy analysis bands in the example are the defaults, but certain customer have a requirement to change them, which is why they can be specified in the context of a project.
-Workflow
------
+## Workflow
Part of the project configuration are also the types of manual, automatic and complex tasks that can be performed within that project. These are referred to as the workflow. Apart from the available tasks, the workflow also specifies a single complex task which will be executed when the project is started. All other tasks are available after that and can be executed by the user as and when required. For more information on tasks, see [About tasks](about_tasks.md).
-Project Templates
------
-It would be obviously tedious to have to set up the entire configuration for every single project. For that reason, the Project Automation API implements the concept of project templates, which constitute named project configurations from which projects can be created quickly. When creating a project based on a project template, the project configuration information stored within that project is copied into the project itself. There is no live link between a project and the project template it was created from, i.e. making changes to one will not affect the other.
+## Project Templates
+Configuring every project from scratch would be tedious. Project templates solve this by storing named configurations from which you can create projects quickly. Creating a project from a template copies the stored configuration into the new project. No live link exists between the two—changes to one do not affect the other.
The screenshot above illustrates how main translation memories are selected in the **New Project** wizard of Var:ProductName.
-See Also
-----------
+## See Also
[Setting the Project Information](setting_the_project_information.md)
[Adding Translation Memories](adding_translation_memories.md)
diff --git a/apiconcepts/projectautomation/project_tm_creation_settings.md b/apiconcepts/projectautomation/project_tm_creation_settings.md
index 1eda5cc459..2f3c17d386 100644
--- a/apiconcepts/projectautomation/project_tm_creation_settings.md
+++ b/apiconcepts/projectautomation/project_tm_creation_settings.md
@@ -1,13 +1,11 @@
-Project TM Creation Settings
-==
+# Project TM Creation Settings
A project translation memory is a subset of a main TM, which contains only TUs that according to the file analysis were found to be relevant for the source documents of a project. Project TMs are not required for standalone scenarios, but are usually created for projects that involve multiple players, e.g. a project manager, external translators, editors, proofreaders, etc. Project TMs are then useful for two main reasons:
* Project TMs are smaller than the main TMs and thus easier to send e.g. in a package via e-mail
* Through project TMs you can make sure that external translators only receive the content that is relevant for the project that they are working on, and no other content, which may be confidential.
-Configuring the Task Settings
---
+## Configuring the Task Settings
As illustrated in the following screenshot the following settings can be configured for project TMs.
@@ -53,33 +51,23 @@ project.UpdateSettings(settings);
>
>File TMs are created in a Tm sub-folder of the project folder strcture. A German project TM would, for example, be stord in a sub-folder called *Tm/de-DE*. The project TM name is a combination of the project name and the name of the main TM from which the project TM was generated.
-Putting it All Together
---
+## Putting it All Together
# [C#](#tab/tabid-4)
```CS
public void GetProjectTmTaskSettings(FileBasedProject project)
{
- #region "TaskSettings"
ISettingsBundle settings = project.GetSettings();
ProjectTranslationMemoryTaskSettings projectTmSettings = settings.GetSettingsGroup();
- #endregion
-
- #region "ProjectTmSettings"
projectTmSettings.CreateServerBasedProjectTranslationMemories.Value = true;
projectTmSettings.ServerConnectionUri.Value = string.Empty;
projectTmSettings.TranslationMemoryContainerName.Value = "TMCont";
- #endregion
-
- #region "UpdateTaskSettings"
project.UpdateSettings(settings);
- #endregion
}
```
***
-See Also
---
+## See Also
[Analyze Files Settings](analyze_files_settings.md)
[Pre-translate Settings](project_tm_creation_settings.md)
diff --git a/apiconcepts/projectautomation/publishing_to_a_server.md b/apiconcepts/projectautomation/publishing_to_a_server.md
index 23fd789116..d9d81ad0e6 100644
--- a/apiconcepts/projectautomation/publishing_to_a_server.md
+++ b/apiconcepts/projectautomation/publishing_to_a_server.md
@@ -1,5 +1,4 @@
-Publishing to a Server
-==
+# Publishing to a Server
It's a simple task to publish a project. To do so you will need to enter the details of your project server (as supplied by your project server administrator) You will also need to log in to the server with a user that has the "Publish Project" permission
diff --git a/apiconcepts/projectautomation/putting_it_all_together.md b/apiconcepts/projectautomation/putting_it_all_together.md
index 07e2470e4d..5f42abb3e6 100644
--- a/apiconcepts/projectautomation/putting_it_all_together.md
+++ b/apiconcepts/projectautomation/putting_it_all_together.md
@@ -1,5 +1,4 @@
-Putting it All Together
-==
+# Putting it All Together
The following example shows the following steps
* Opening a server project and creating a new local copy.
* Overriding files checked out by other users.
@@ -111,8 +110,7 @@ void ServerPuttingItAllTogether()
```
***
-See Also
---
+## See Also
[About Server Based Projects](about_server_based_projects.md)
[Connecting a Project to a Project Server](connecting_a_project_to_a_project_server.md)
diff --git a/apiconcepts/projectautomation/required_references_and_namespaces.md b/apiconcepts/projectautomation/required_references_and_namespaces.md
index 6a8b0d5137..febfead32b 100644
--- a/apiconcepts/projectautomation/required_references_and_namespaces.md
+++ b/apiconcepts/projectautomation/required_references_and_namespaces.md
@@ -1,9 +1,7 @@
-Required References and Namespaces
-===
+# Required References and Namespaces
To develop 'against' the Project Automation API your project needs to use the following libraries as references:
-Reference Libraries to Add
---
+## Reference Libraries to Add
* Sdl.Core.Globalization
* Sdl.Core.Settings
@@ -20,8 +18,7 @@ Finally, the **Sdl.ProjectAutomation.Settings** assembly exposes a number of set

-Namespaces to Use
---
+## Namespaces to Use
The classes of your project needs to use the following namespaces:
* System.Globalization
@@ -31,15 +28,13 @@ The classes of your project needs to use the following namespaces:
* Sdl.ProjectAutomation.FileBased
* Sdl.ProjectAutomation.Settings
-Further Requirements
---
+## Further Requirements
In addition to the above, you should observer the following:
* As build output location choose the installation folder of Var:ProductName , e.g. *Var:InstallationFolder*
* Configure your projects as x84 applications, as otherwise they will not work when running on 64 bit platforms. Therefore, set the platform target of your projects to x84.
-References from the Translation Memory API
---
+## References from the Translation Memory API
For some implementations it may be necessary to leverage the functionality of the Translation Memory API. In fact, this SDK describes the development of [IProject](../../api/projectautomation/Sdl.ProjectAutomation.Core.IProject.yml) a sample application that uses the Project Automation API to run a batch analysis and at the same time requires some of the functionality offered by the TM API to read certain information from a TM setup (see [Introduction to the Sample Application](introduction_to_the_sample_app.md)).
If you need to use the TM API in your implementation, you require the following references in addition:
@@ -55,8 +50,7 @@ Your class needs to use the following namespaces:
* Sdl.LanguagePlatform.Core.Tokenization
* Sdl.LanguagePlatform.Core
-See Also
---
+## See Also
[Setting up a Developer Machine](../../articles/gettingstarted/setting_up_a_developer_machine.md)
[Platform Support](../../articles/gettingstarted/platform_support.md)
diff --git a/apiconcepts/projectautomation/retrieving_the_project_statistics.md b/apiconcepts/projectautomation/retrieving_the_project_statistics.md
index ddbd25553f..f4a5d04f9c 100644
--- a/apiconcepts/projectautomation/retrieving_the_project_statistics.md
+++ b/apiconcepts/projectautomation/retrieving_the_project_statistics.md
@@ -1,5 +1,4 @@
-Retrieving the Project Statistics
-==
+# Retrieving the Project Statistics
During a project lifecycle the segments contained in the project files typically go through a set of states:
@@ -12,8 +11,7 @@ During a project lifecycle the segments contained in the project files typically
* Sign-off rejected
* The total number of translated and untranslated segments is used to compute the statistics for the project. That way project managers can ascertain the project status at a glance. Using the number of translated and untranslated words project managers can quickly give an estimate of whether the project is on track or not.
-Retrieve the Project Statistics Programmatically
---
+## Retrieve the Project Statistics Programmatically
Below you see an example of how Var:ProductName uses bar charts to visualize the project statistics:
@@ -25,15 +23,8 @@ Below you will find an example of how to retrieve basic statistical information
```cs
public void GetProjectStatistics(FileBasedProject project)
{
- #region "GetProjectStatistics"
ProjectStatistics projStats = project.GetProjectStatistics();
- #endregion
-
- #region "TargetLanguageStatistics"
TargetLanguageStatistics[] targetStats = projStats.TargetLanguageStatistics;
- #endregion
-
- #region "trgInfo"
StringBuilder trgInfo = new StringBuilder();
for (int i = 0; i < targetStats.Length; i++)
{
@@ -51,7 +42,6 @@ public void GetProjectStatistics(FileBasedProject project)
}
MessageBox.Show(trgInfo.ToString());
- #endregion
}
```
***
@@ -98,8 +88,7 @@ MessageBox.Show(trgInfo.ToString());
The above is just an example of what kind of statistical information you can retrieve for a project and its target languages. Another example, which shows how to retrieve detailed analysis information can be found in the chapters [Generating the Task Report](generating_the_task_report.md).
-Putting it All Together
---
+## Putting it All Together
The complete function should now look as shown below:
@@ -107,15 +96,8 @@ The complete function should now look as shown below:
```cs
public void GetProjectStatistics(FileBasedProject project)
{
- #region "GetProjectStatistics"
ProjectStatistics projStats = project.GetProjectStatistics();
- #endregion
-
- #region "TargetLanguageStatistics"
TargetLanguageStatistics[] targetStats = projStats.TargetLanguageStatistics;
- #endregion
-
- #region "trgInfo"
StringBuilder trgInfo = new StringBuilder();
for (int i = 0; i < targetStats.Length; i++)
{
@@ -133,13 +115,11 @@ public void GetProjectStatistics(FileBasedProject project)
}
MessageBox.Show(trgInfo.ToString());
- #endregion
}
```
***
-See Also
---
+## See Also
[Generating the Task Report](generating_the_task_report.md)
[About Project Files](about_project_files.md)
diff --git a/apiconcepts/projectautomation/running_tasks_on_project_files.md b/apiconcepts/projectautomation/running_tasks_on_project_files.md
index 7a28a50756..5c6f3b1260 100644
--- a/apiconcepts/projectautomation/running_tasks_on_project_files.md
+++ b/apiconcepts/projectautomation/running_tasks_on_project_files.md
@@ -1,10 +1,8 @@
-Running Tasks on the Project Files
-==
+# Running Tasks on the Project Files
For further processing of the project files a number of so-called automated batch tasks is executed. Batch tasks are used, for example, to convert the native files into the bilingual (SDLXliff) format for further processing. Other examples include word count, file analysis, and pre-translation. Var:ProductName allows you to put compile single tasks into a task sequence, which can then be run on the entire project. This chapter demonstrates how to programmatically run batch tasks on project files. There are separate chapters deal with tasks in more detail, e.g. provide they further information on the various configuration settings that you can choose before executing a task.
-General Information on Tasks
---
+## General Information on Tasks
The screenshot below shows the standard Prepare compound tasks and the sub-tasks that it contains:
@@ -19,8 +17,7 @@ The preparation of the project files involves the following tasks:
* **Pre-translate Files**: Any existing translations found in the main TM(s) are inserted automatically into the project files.
* **Populate Project Translation Memories**: Creates project TMs from the main TMs. A project TM constitutes a subset of the its corresponding main TM. Project TMs only contain the TUs that are relevant for the current project. That way project managers can make sure that they do not have to forward the entire TM content to e.g. freelance translators, but only those TUs that match the project files.
-Add the Function for Running the Tasks
---
+## Add the Function for Running the Tasks
The aim of this example is to show how to run the tasks that are described above programmatically. Implement a helper function called PrepareFiles. This function is the programmatic equivalent to the **Prepare** task used in Var:ProductName. This function takes a [FileBasedProject](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml) object as parameter. The function can thus be called as follows:
@@ -83,7 +80,6 @@ The helper function gets the project target files for the specified language by
```CS
public void ProcessTargetLanguageFiles(FileBasedProject project, string locale)
{
- #region "PerfectMatchSetupAndTask"
Language targetLanguage = new Language(CultureInfo.GetCultureInfo(locale));
ProjectFile[] targetFiles = project.GetTargetLanguageFiles(targetLanguage);
@@ -93,8 +89,6 @@ public void ProcessTargetLanguageFiles(FileBasedProject project, string locale)
AutomaticTask perfectMatchTask = project.RunAutomaticTask(
targetFiles.GetIds(),
AutomaticTaskTemplateIds.PerfectMatch);
- #endregion
-
AutomaticTask analzyeTask = project.RunAutomaticTask(
targetFiles.GetIds(),
AutomaticTaskTemplateIds.AnalyzeFiles);
@@ -110,8 +104,7 @@ public void ProcessTargetLanguageFiles(FileBasedProject project, string locale)
```
***
-Check for Task Events
---
+## Check for Task Events
Tasks might fail due to particular circumstances. For example, Microsoft Word files that contain unaccepted changes can by default not be processed. Therefore, when you try to convert such a DOC file to SDLXliff, the task will fail with an error message. Therefore, it is recommended that you check for the status of the current task and act accordingly, e.g. when the current task has the status [Failed](../../api/projectautomation/Sdl.ProjectAutomation.Core.TaskStatus.yml#fields). You could then, for example, output a message to alert the user and suggest a way of fixing this problem (if applicable). In this step we will implement another helper function called CheckEvents. It uses the [TaskStatus](../../api/projectautomation/Sdl.ProjectAutomation.Core.TaskStatus.yml) class to check the current task status. In this simple implementation we just use a break statement regardless of the current status. In a real-life implementation you would, for example, output an error message when the status is [Failed](../../api/projectautomation/Sdl.ProjectAutomation.Core.TaskStatus.yml#fields). The helper function for checking the task status should look as shown below:
@@ -171,8 +164,7 @@ CheckEvents(taskStatusEventArgsList, messageEventArgsList);
```
***
-Putting it All Together
---
+## Putting it All Together
Below you see what the above mentioned functions should look like when all is put together:
@@ -180,11 +172,8 @@ Below you see what the above mentioned functions should look like when all is pu
```CS
public void PrepareFiles(FileBasedProject project)
{
- #region "EventArgs"
List taskStatusEventArgsList = new List();
List messageEventArgsList = new List();
- #endregion
-
ProjectFile[] sourceFiles = project.GetSourceLanguageFiles();
for (int i = 0; i < sourceFiles.Length; i++)
@@ -223,12 +212,8 @@ public void ProcessTargetLanguageFilesExtended(FileBasedProject project, string
targetFiles.GetIds(),
AutomaticTaskTemplateIds.AnalyzeFiles);
this.CheckEvents(taskStatusEventArgsList, messageEventArgsList);
-
- #region "SaveAnalysisReport"
Guid reportId = analyzeTask.Reports[0].Id;
project.SaveTaskReportAs(reportId, @"C:\ProjectFiles\Analysis_report.xls", ReportFormat.Excel);
- #endregion
-
AutomaticTask translateTask = project.RunAutomaticTask(
targetFiles.GetIds(),
AutomaticTaskTemplateIds.PreTranslateFiles);
@@ -281,8 +266,7 @@ private void CheckEvents(List taskStatusEventArgsList, List
```
***
-See Also
---
+## See Also
[Automatic Tasks and Task Settings](automatic_tasks_and_task_settings.md)
[Analyze Files Settings](analyze_files_settings.md)
diff --git a/apiconcepts/projectautomation/sample_app_putting_it_all_together.md b/apiconcepts/projectautomation/sample_app_putting_it_all_together.md
index c83150a05c..dd873a466f 100644
--- a/apiconcepts/projectautomation/sample_app_putting_it_all_together.md
+++ b/apiconcepts/projectautomation/sample_app_putting_it_all_together.md
@@ -1,5 +1,4 @@
-Putting it All Together
-==
+# Putting it All Together
For completeness, this page shows the full ```ProjectCreator``` class.
@@ -19,13 +18,7 @@ namespace SDK.ProjectAutomation.Samples.BatchAnaylze
public class ProjectCreator
{
-
- #region "ReportId"
private Guid reportId;
- #endregion
-
- #region "Create"
- #region "CreateMainFunction"
///
/// Creates the actual project that is used as a container for
/// the files to analyze. Triggers all subsequent helper function
@@ -41,69 +34,29 @@ namespace SDK.ProjectAutomation.Samples.BatchAnaylze
bool reportInternalFuzzyMatchLeverage,
bool keepProjectFiles,
bool publishToServer)
- #endregion
-
{
- #region "RetrieveTmLanguages"
-
FileBasedTranslationMemory fileTm = new FileBasedTranslationMemory(tmFile);
string srcLocale = fileTm.LanguageDirection.SourceLanguage.ToString();
string trgLocale = fileTm.LanguageDirection.TargetLanguage.ToString();
-
- #endregion
-
- #region "newProject"
-
FileBasedProject newProject = new FileBasedProject(this.GetProjectInfo(srcLocale, trgLocale));
-
- #endregion
-
- #region "CallAddFiles"
-
this.AddFiles(newProject, docFolder, recursion);
-
- #endregion
-
if (publishToServer)
{
- #region "CallAddServerTm"
this.AddServerTm(newProject, "http://MyTMServerAddress","/MyOrganizationPath", tmFile, false, "MyUserName", "MyPassword");
- #endregion
}
else
{
- #region "CallAddTm"
this.AddTm(newProject, tmFile);
- #endregion
}
-
-
- #region "CallConvert"
this.ConvertFiles(newProject);
- #endregion
-
- #region "CallGetAnalyzeSettings"
this.GetAnalyzeSettings(
newProject,
trgLocale,
reportCrossFileRepetitions,
reportInternalFuzzyMatchLeverage);
- #endregion
-
- #region "CallRunFileAnalysis"
this.RunFileAnalysis(newProject, trgLocale);
- #endregion
-
- #region "GenerateReports"
this.CreateReports(newProject, docFolder);
- #endregion
-
- #region "Save"
newProject.Save();
- #endregion
-
- #region "PublishToServer"
-
newProject.PublishProject(
new Uri("ps.http://MyProjectServer:80"),
false,
@@ -111,97 +64,52 @@ namespace SDK.ProjectAutomation.Samples.BatchAnaylze
"MyPassword",
"/MyOrganizationPath",
null);
- #endregion
-
- #region "CallDeleteProject"
if (!keepProjectFiles)
{
newProject.Delete();
}
- #endregion
}
- #endregion
-
- #region "GetProjectInfo"
- #region "GetProjectInfoFunction"
///
/// Configures the project information, i.e. the project location (folder), the project name,
/// and the source/target language.
///
private ProjectInfo GetProjectInfo(string srcLocale, string trgLocale)
- #endregion
{
- #region "ProjectInfo"
ProjectInfo info = new ProjectInfo();
- #endregion
-
- #region "ProjectName"
string nameExt = DateTime.Now.ToString();
nameExt = nameExt.Replace('.', '_');
nameExt = nameExt.Replace(':', '_');
nameExt = nameExt.Replace('/', '_');
nameExt = nameExt.Replace(' ', 'T');
info.Name = "BatchAnalyzer_" + nameExt;
- #endregion
-
- #region "ProjectFolder"
string localProjectFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments).ToString() +
Path.DirectorySeparatorChar + $@"{Versioning.Versions.StudioDocumentsFolderName}\Projects\" + info.Name;
info.LocalProjectFolder = localProjectFolder;
- #endregion
-
- #region "SetProjectSourceLanguage"
Language srcLang = new Language(CultureInfo.GetCultureInfo(srcLocale));
info.SourceLanguage = srcLang;
- #endregion
-
- #region "SetProjectTargetLanguage"
Language[] trgLang = new Language[] { new Language(CultureInfo.GetCultureInfo(trgLocale)) };
info.TargetLanguages = trgLang;
- #endregion
-
- #region "ReturnInfo"
return info;
- #endregion
}
- #endregion
-
- #region "Addfolder"
///
/// Adds the files from the specified folder to the project and sets the file use, e.g. translatable or reference.
///
- #region "AddFilesFunction"
private void AddFiles(FileBasedProject project, string folder, bool recursion)
- #endregion
{
- #region "AddFolderWithFiles"
project.AddFolderWithFiles(folder, recursion);
- #endregion
-
- #region "GetSourceLanguageFiles"
ProjectFile[] projectFiles = project.GetSourceLanguageFiles();
AutomaticTask scan = project.RunAutomaticTask(
projectFiles.GetIds(),
AutomaticTaskTemplateIds.Scan);
- #endregion
}
- #endregion
-
- #region "AddTm"
///
/// Adds the TM that should be used for the analysis. The project languages are
/// set according to the TM.
///
- #region "AddTmFunction"
private void AddTm(FileBasedProject project, string tmFilePath)
- #endregion
{
- #region "TranslationProviderConfiguration"
TranslationProviderConfiguration config = project.GetTranslationProviderConfiguration();
- #endregion
-
- #region "TranslationProviderCascadeEntry"
TranslationProviderCascadeEntry tm = new TranslationProviderCascadeEntry(
tmFilePath,
true,
@@ -210,25 +118,15 @@ namespace SDK.ProjectAutomation.Samples.BatchAnaylze
config.Entries.Add(tm);
project.UpdateTranslationProviderConfiguration(config);
- #endregion
}
- #endregion
-
- #region "AddServerTm"
- #region "AddServerTmFunction"
///
/// Add a server TM to be used for anaysis. The project languages are
/// set according to the TM.
///
private void AddServerTm(FileBasedProject project, string serverAddress, string organizationPath, string tmName, bool useWindowsSecurity, string username, string password)
- #endregion
{
- #region "TranslationProviderConfiguration"
Uri tmAddress = new Uri(String.Format("sdltm.{1}{2}/{3}", serverAddress, organizationPath, tmName));
TranslationProviderConfiguration config = project.GetTranslationProviderConfiguration();
- #endregion
-
- #region "TranslationProviderCascadeEntryForServerTM"
TranslationProviderCascadeEntry tm = new TranslationProviderCascadeEntry
(
new TranslationProviderReference(tmAddress),
@@ -238,27 +136,16 @@ namespace SDK.ProjectAutomation.Samples.BatchAnaylze
);
config.Entries.Add(tm);
project.UpdateTranslationProviderConfiguration(config);
- #endregion
-
- #region "CredentialsForServerTm"
project.Credentials.AddCredential(new Uri(serverAddress), String.Format("user={0};password={1};type=CustomUser", username, password, useWindowsSecurity ? "WindowsUser" : "CustomUser"));
project.UpdateTranslationProviderConfiguration(config);
- #endregion
}
- #endregion
-
- #region "ConvertAndCopy"
///
/// Runs the two automatic tasks: Convert translatable files to a translatable format (i.e. SDLXliff)
/// and creates target file copies.
///
private void ConvertFiles(FileBasedProject project)
{
- #region "GetFilesForProcessing"
ProjectFile[] files = project.GetSourceLanguageFiles();
- #endregion
-
- #region "RunConversion"
for (int i = 0; i < project.GetSourceLanguageFiles().Length; i++)
{
if (files[i].Role == FileRole.Translatable)
@@ -267,44 +154,23 @@ namespace SDK.ProjectAutomation.Samples.BatchAnaylze
AutomaticTask convertTask = project.RunAutomaticTask(
currentFileId,
AutomaticTaskTemplateIds.ConvertToTranslatableFormat);
-
- #region "CopyToTarget"
AutomaticTask copyTask = project.RunAutomaticTask(
currentFileId,
AutomaticTaskTemplateIds.CopyToTargetLanguages);
- #endregion
}
}
- #endregion
}
- #endregion
-
- #region "RunFileAnalysis"
- #region "RunFileAnalysisFunction"
///
/// Runs the actual analyze files task on the SDLXliff target documents.
///
private void RunFileAnalysis(FileBasedProject project, string trgLocale)
- #endregion
{
- #region "GetTargetLanguageFiles"
ProjectFile[] targetFiles = project.GetTargetLanguageFiles(new Language(CultureInfo.GetCultureInfo(trgLocale)));
- #endregion
-
- #region "RunAnalysis"
AutomaticTask analyzeTask = project.RunAutomaticTask(
targetFiles.GetIds(),
AutomaticTaskTemplateIds.AnalyzeFiles);
- #endregion
-
- #region "SetTaskId"
this.reportId = analyzeTask.Reports[0].Id;
- #endregion
}
- #endregion
-
- #region "GetAnalyzeSettings"
- #region "GetAnalyzeSettingsFunction"
///
/// Configures the analyze task file settings, i.e. in our implementation
/// report cross-file repetitions and report the internal fuzzy match leverage.
@@ -314,46 +180,24 @@ namespace SDK.ProjectAutomation.Samples.BatchAnaylze
string trgLocale,
bool reportCrossFileRepetitions,
bool reportInternalFuzzyMatchLeverage)
- #endregion
{
- #region "trgLanguage"
Language trgLanguage = new Language(CultureInfo.GetCultureInfo(trgLocale));
- #endregion
-
- #region "ISettingsBundle"
ISettingsBundle settings = project.GetSettings(trgLanguage);
AnalysisTaskSettings analyzeSettings = settings.GetSettingsGroup();
- #endregion
-
- #region "ConfigureSettings"
analyzeSettings.ReportCrossFileRepetitions.Value = reportCrossFileRepetitions;
analyzeSettings.ReportInternalFuzzyMatchLeverage.Value = reportInternalFuzzyMatchLeverage;
- #endregion
-
- #region "UpdateSettings"
project.UpdateSettings(trgLanguage, settings);
- #endregion
}
- #endregion
-
- #region "CreateReports"
///
/// Retrieves the results of the analyze files tasks and generates a standard
/// report in Microsoft Excel format as well as a report in a custom XML format.
///
private void CreateReports(FileBasedProject project, string path)
{
- #region "CreateStandardReport"
project.SaveTaskReportAs(this.reportId, path + "/AnalyzeTaskReport.xls", ReportFormat.Excel);
- #endregion
-
- #region "Statistics"
ProjectStatistics projectStats = project.GetProjectStatistics();
TargetLanguageStatistics[] targetStats = projectStats.TargetLanguageStatistics;
AnalysisStatistics analysisStats = targetStats[0].AnalysisStatistics;
- #endregion
-
- #region "WriteData"
string result = "Analysis result for all files:\n\n";
result += "\nPerfect matches\n";
@@ -369,17 +213,12 @@ namespace SDK.ProjectAutomation.Samples.BatchAnaylze
result += "Characters: " + analysisStats.InContextExact.Characters.ToString() + "\n";
result += "Tags: " + analysisStats.InContextExact.Tags.ToString() + "\n";
result += "Placeables: " + analysisStats.InContextExact.Placeables.ToString() + "\n";
-
- #region "Exact"
result += "\nExact matches\n";
result += "Segments: " + analysisStats.Exact.Segments.ToString() + "\n";
result += "Words: " + analysisStats.Exact.Words.ToString() + "\n";
result += "Characters: " + analysisStats.Exact.Characters.ToString() + "\n";
result += "Tags: " + analysisStats.Exact.Tags.ToString() + "\n";
result += "Placeables: " + analysisStats.Exact.Placeables.ToString() + "\n";
- #endregion
-
- #region "Fuzzy"
for (int i = 0; i < analysisStats.Fuzzy.Length; i++)
{
string rangeMax = analysisStats.Fuzzy[i].Band.MaximumMatchValue.ToString();
@@ -392,8 +231,6 @@ namespace SDK.ProjectAutomation.Samples.BatchAnaylze
result += "Tags: " + analysisStats.Fuzzy[i].Tags.ToString() + "\n";
result += "Placeables: " + analysisStats.Fuzzy[i].Placeables.ToString() + "\n";
}
- #endregion
-
result += "\nRepetitions\n";
result += "Segments: " + analysisStats.Repetitions.Segments.ToString() + "\n";
result += "Words: " + analysisStats.Repetitions.Words.ToString() + "\n";
@@ -416,10 +253,7 @@ namespace SDK.ProjectAutomation.Samples.BatchAnaylze
result += "Placeables: " + analysisStats.Total.Placeables.ToString() + "\n";
Console.Write(result);
-
- #endregion
}
- #endregion
}
}
```
diff --git a/apiconcepts/projectautomation/saving_task_reports.md b/apiconcepts/projectautomation/saving_task_reports.md
index daf3e15101..ba7eb73ba8 100644
--- a/apiconcepts/projectautomation/saving_task_reports.md
+++ b/apiconcepts/projectautomation/saving_task_reports.md
@@ -1,5 +1,4 @@
-Saving Task Reports
-==
+# Saving Task Reports
Executing certain tasks automatically creates reports in the background. These reports are saved in a *Reports* sub-folder within the project folder structure. The report files are in XML format (e.g. *Analyze Files en-US_de-DE.xml*). For an analysis task a report contains the number of segments, words, characters, tags, and placeables that were found within the different TM match categories, i.e. context, exact, fuzzy matches, etc.
@@ -29,8 +28,7 @@ project.SaveTaskReportAs(reportId, @"C:\ProjectFiles\Analysis_report.xls", Repor
```
***
-See Also
---
+## See Also
[Running Tasks on the Project Files](running_tasks_on_project_files.md)
[Generating the Task Report](generating_the_task_report.md)
diff --git a/apiconcepts/projectautomation/setting_the_project_information.md b/apiconcepts/projectautomation/setting_the_project_information.md
index 1e2734446f..8aabb6e369 100644
--- a/apiconcepts/projectautomation/setting_the_project_information.md
+++ b/apiconcepts/projectautomation/setting_the_project_information.md
@@ -1,10 +1,8 @@
-Setting the Project Information
-==
-In this chapter you will learn how to programmatically create a simple project, and define the general project properties such as name, description, due date, etc.
+# Setting the Project Information
+This chapter demonstrates how to programmatically create a project and define its general properties—name, description, due date, and more.
-Create the Project
---
-Start by implementing a function called ``` CreateProject```. Create a file-based project object called ```newProject``` based on the class [FileBasedProject](../../api\projectautomation\Sdl.ProjectAutomation.FileBased.FileBasedProject.yml). In our example we provide the project properties as parameter. We recommend that you generate the project properties through a separate helper function called e.g. GetProjectInfo as shown below:
+## Create the Project
+Start by implementing a function called ``` CreateProject```. Create a file-based project object called ```newProject``` based on the class [FileBasedProject](../../api\projectautomation\Sdl.ProjectAutomation.FileBased.FileBasedProject.yml) class. Pass the project properties as a parameter—we recommend generating them through a separate helper function such as `GetProjectInfo`:
# [C#](#tab/tabid-1)
```CS
@@ -12,8 +10,7 @@ FileBasedProject newProject = new FileBasedProject(info);
```
***
-Set the Project Information
---
+## Set the Project Information
In the GetProjectInfo helper function, we first create a [ProjectInfo](../../api\projectautomation\Sdl.ProjectAutomation.Core.ProjectInfo.yml) object:
# [C#](#tab/tabid-2)
@@ -40,8 +37,7 @@ In the above example we set the following parameters:
The screenshot below illustrates how this information is entered in the **New Project** wizard of Var:ProductName.

-Set the Local Project Folder
---
+## Set the Local Project Folder
All project files, i.e. translatable and localizable documents, reference files, project TMs, etc. are stored in a specific folder. By default, the main folder used for storing projects is: Var:DefaultProjectsFolder. Below this main folder Var:ProductName creates sub-folders that carry the name of the respective project. However, you could just as well pick any other folder name, as long as the specified folder is empty so as to avoid collisions with existing files. In the example below we follow the default folder rule of Var:ProductName by selecting the Var:StudioDocumentsFolderName\Projects\ folder below Documents, and by appending the project name sub-folder. We then set the [LocalProjectFolder](../../api/projectautomation/Sdl.ProjectAutomation.Core.ProjectInfo.yml#Sdl_ProjectAutomation_Core_ProjectInfo_LocalProjectFolder) property accordingly as shown in the example below:
# [C#](#tab/tabid-4)
```CS
@@ -51,8 +47,7 @@ string localProjectFolder = Environment.GetFolderPath(Environment.SpecialFolder.
info.LocalProjectFolder = localProjectFolder;
```
***
-Select the Project Languages
---
+## Select the Project Languages
A project must have at least one language pair, i.e. a source language and one target language. Projects can have only one source language, but multiple target languages. The screenshot below highlights how languages are selected in Var:ProductName:

@@ -96,51 +91,32 @@ Even if you have not added any translatable files yet, you will end up generatin
Also note that the Var:DefaultProjectsFolder folder contains a file called projects.xml. This is a meta file that contains references to all the projects that have been created in Var:ProductName. The projects that you create programmatically will not be referenced in this file, and thus not be listed in Var:ProductName, which is by design. However, you can, of course, open the programmatically created *.sdlproj file in Var:ProductName.
-Putting it All Together
---
+## Putting it All Together
The complete function for setting the project properties should look as shown below:
# [C#](#tab/tabid-9)
```CS
public ProjectInfo GetProjectInfo()
{
- #region "InfoObject"
ProjectInfo info = new ProjectInfo();
- #endregion
-
- #region "GeneralInfo"
info.Name = "My first project";
info.Description = "This is a programmatically created project.";
info.DueDate = DateTime.Now.AddDays(3);
- #endregion
-
- #region "ProjectFolder"
string localProjectFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments).ToString() +
Path.DirectorySeparatorChar + $@"{Versioning.Versions.StudioDocumentsFolderName}\Projects\" + info.Name;
info.LocalProjectFolder = localProjectFolder;
- #endregion
-
- #region "SourceLanguage"
Language srcLang = new Language(CultureInfo.GetCultureInfo("en-US"));
info.SourceLanguage = srcLang;
- #endregion
-
- #region "TargetLanguages"
Language[] trgLangs = new Language[] { new Language(CultureInfo.GetCultureInfo("de-DE")), new Language(CultureInfo.GetCultureInfo("fr-FR")) };
info.TargetLanguages = trgLangs;
- #endregion
-
- #region "ReturnInfo"
return info;
- #endregion
}
```
***
-See Also
---
+## See Also
[Adding Files and Folders](adding_files_and_folders.md)
[Adding Translation Memories](adding_translation_memories.md)
diff --git a/apiconcepts/projectautomation/setting_tm_penalties.md b/apiconcepts/projectautomation/setting_tm_penalties.md
index 427700c024..044c187829 100644
--- a/apiconcepts/projectautomation/setting_tm_penalties.md
+++ b/apiconcepts/projectautomation/setting_tm_penalties.md
@@ -1,5 +1,4 @@
-Setting TM Penalties
-==
+# Setting TM Penalties
It can happen that a match that was found in a translation memory is linguistically speaking an exact match for the current segment. However, it should not be shown as a 100% match to the user, for example, because of formatting differences. In this case a penalty should be applied to alert the user to the fact that event though an exact match has been retrieved, the suggested translation still requires editing. If the penalty value is e.g. 1%, one percentage point will be deducted from the original score for each formatting difference. Example: If the TM contains a 100% match with two formatting differences, the 100% match will be reduced to a 98% match. Translators are thereby made aware that they should not accept the translation suggestion as is without adapting the formatting in the target segment.
@@ -25,8 +24,7 @@ tmSettings.CharacterWidthDifferencePenalty.Value = 2;
```
***
-See Also
---
+## See Also
[Translation Memory Search Settings](translation_memory_search_settings.md)
[Translation Memory Fields Update](translation_memory_field_update.md)
diff --git a/apiconcepts/projectautomation/setting_up_the_visual_studio_project.md b/apiconcepts/projectautomation/setting_up_the_visual_studio_project.md
index 53b76d7ce3..36b90e5f3c 100644
--- a/apiconcepts/projectautomation/setting_up_the_visual_studio_project.md
+++ b/apiconcepts/projectautomation/setting_up_the_visual_studio_project.md
@@ -1,5 +1,4 @@
-Setting up the Visual Studio Project
-==
+# Setting up the Visual Studio Project
Start by creating a new console Application in Microsoft Visual Studio 2010.
@@ -26,6 +25,5 @@ Note that we require the functionality of the Translation Memory API to access i
Make sure to set the project build output location to the Var:ProductName installation folder, e.g. *Var:InstallationFolder*. **Important note**: Set the platform target of your projects to x86.
-See Also
---
+## See Also
[Required References and Namespaces](required_references_and_namespaces.md)
diff --git a/apiconcepts/projectautomation/synchronizing_with_project_server.md b/apiconcepts/projectautomation/synchronizing_with_project_server.md
index 231e5d68f5..8fb3521615 100644
--- a/apiconcepts/projectautomation/synchronizing_with_project_server.md
+++ b/apiconcepts/projectautomation/synchronizing_with_project_server.md
@@ -1,10 +1,8 @@
-Synchronizing With Project Server
-==
+# Synchronizing With Project Server
When using Var:ProductName, synchronization between the server and the local copy occurs every 5 seconds. This makes sure that changes made by other users are reflected in the local copy. In the Project Automation API it is the responsibility of the developer to make sure that synchronization is performed before you access any files or settings and after you have made changes to any files or settings.
-How to Synchronize and what Synchronization Does
---
+## How to Synchronize and what Synchronization Does
Synchronization ensures that all the changes made by other users since the last time the project was synchronised are copied to the local copy. Only the status of the files are synchronised. The actual physical files must be explicitly downloaded.
@@ -20,8 +18,7 @@ project.SynchronizeServerProjectData();
>
>Synchronization does not automatically upload or download files only the status of the files and the project settings.
-See Also
---
+## See Also
[About Server Based Projects](about_server_based_projects.md)
[Connecting a Project to a Project Server](connecting_a_project_to_a_project_server.md)
diff --git a/apiconcepts/projectautomation/the_command_line_parameters.md b/apiconcepts/projectautomation/the_command_line_parameters.md
index 680aebc264..2f1cbcfe4e 100644
--- a/apiconcepts/projectautomation/the_command_line_parameters.md
+++ b/apiconcepts/projectautomation/the_command_line_parameters.md
@@ -1,10 +1,8 @@
-The Command-line Parameters
-==
+# The Command-line Parameters
This chapter explains which parameters are used in the command-line application, how to set them in the Program.cs class, and check for the validity of the parameters.
-Add the Required Variables
---
+## Add the Required Variables
Within main declare the three following variables for setting the following parameters:
@@ -130,8 +128,7 @@ catch (Exception ex)
```
***
-Putting it All Together
---
+## Putting it All Together
The full implementation should look as shown below:
@@ -139,7 +136,6 @@ The full implementation should look as shown below:
```cs
public static void Main(string[] args)
{
- #region "DeclareVariables"
string mainPath = string.Empty;
string tmFile = string.Empty;
bool processSubFolders = false;
@@ -147,9 +143,6 @@ public static void Main(string[] args)
bool reportInternalFuzzyMatchLeverage = false;
bool keepProjectFiles = false;
bool publishToServer = false;
- #endregion
-
- #region "Usage"
if (args.Length < 2)
{
Console.WriteLine("Usage:");
@@ -163,18 +156,12 @@ public static void Main(string[] args)
Console.WriteLine("/p publish to a server");
return;
}
- #endregion
-
- #region "CheckPath"
if (!String.IsNullOrEmpty(args[0]) && !Directory.Exists(args[0])
&& !String.IsNullOrEmpty(args[1]) )
{
Console.WriteLine("Please specify a valid input directory and a valid TM. Press ENTER to exit.");
return;
}
- #endregion
-
- #region "SetVariables"
mainPath = args[0];
tmFile = args[1];
@@ -199,19 +186,11 @@ public static void Main(string[] args)
break;
}
}
-
- #endregion
-
- #region "CheckTMPathIfFileTM"
-
if (!publishToServer && !File.Exists(args[1]))
{
Console.WriteLine("Please specify a valid file TM. Press ENTER to exit.");
return;
}
- #endregion
-
- #region "ProcessTask"
try
{
ProjectCreator process = new ProjectCreator();
@@ -232,11 +211,9 @@ public static void Main(string[] args)
Console.WriteLine(ex.Message);
Console.ReadLine();
}
- #endregion
}
```
***
-See Also
---
+## See Also
[Configuring the Project Properties](configuring_the_project_properties.md)
diff --git a/apiconcepts/projectautomation/threading_support.md b/apiconcepts/projectautomation/threading_support.md
index 51ea7a781d..9c760f86f8 100644
--- a/apiconcepts/projectautomation/threading_support.md
+++ b/apiconcepts/projectautomation/threading_support.md
@@ -1,9 +1,7 @@
-Threading Support
-=====
-This section contains information about multithreading when using the Project Automation API.
+# Threading Support
+This section covers multithreading considerations for the Project Automation API.
-Multithreading
------
+## Multithreading
The [FileBasedProject](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml) class is not thread-safe. This means it is not safe to access the same instance of [FileBasedProject](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.FileBasedProject.yml) from two or more different threads.
-In addition, it is not recommended to work with multiple projects simultaneously on different threads. If you do want to create an application that, for example, creates projects simultaneously, we recommend that you to do this in separate processes, rather than in separate threads within the same process.
+Working with multiple projects simultaneously on different threads is not recommended. To create projects in parallel, use separate processes rather than separate threads within the same process.
diff --git a/apiconcepts/projectautomation/translation_count.md b/apiconcepts/projectautomation/translation_count.md
index 8cf3dc417f..d02e43acb8 100644
--- a/apiconcepts/projectautomation/translation_count.md
+++ b/apiconcepts/projectautomation/translation_count.md
@@ -1,5 +1,4 @@
-Translation Count
-==
+# Translation Count
The translation count task is used to calculate the translation progress of a given current project. It determines the status (confirmation level) of the segments and words contained in the project files, i.e. it calculates how many segments, words, and characters have reached the confirmation levels e.g. translated, reviewed, signed-off, etc. This task is quite likely to be run several times during a project lifecycle in order to determine the current progress of a project. Note that for this task there are no specific settings.
@@ -24,8 +23,7 @@ public void RunTranslationCount(FileBasedProject project, string trgLocale)
```
***
-See Also
---
+## See Also
[Analyze Files Settings](analyze_files_settings.md)
[Project TM Creation Settings](project_tm_creation_settings.md)
diff --git a/apiconcepts/projectautomation/translation_memory_field_update.md b/apiconcepts/projectautomation/translation_memory_field_update.md
index 79925a1545..092bd3ad02 100644
--- a/apiconcepts/projectautomation/translation_memory_field_update.md
+++ b/apiconcepts/projectautomation/translation_memory_field_update.md
@@ -1,5 +1,4 @@
-Translation Memory Fields Update
-==
+# Translation Memory Fields Update
The setup of a translation memory can contain so-called TM fields. This is meta information that can be added to each translation unit, e.g. *Customer, Project id, Department*, etc. For more information see the corresponding section of the Translation Memory API.
@@ -9,8 +8,7 @@ The screenshot below illustrates how, for example, the TM fields *Client* and *P

-Retrieving TM Fields
---
+## Retrieving TM Fields
In order to set the TM fields to use for a project you require the functionality of the Translation Memory API. Please refer to the chapter [Required References and Namespaces](required_references_and_namespaces.md) for detailed information on the libraries and the namespaces that you need to add to your project in order to use the TM API.
@@ -36,8 +34,7 @@ tmSettings.ProjectSettings.Value = fieldValuesCollection;
```
***
-Retrieving Fields from the TM Setup
---
+## Retrieving Fields from the TM Setup
In the example above we simply hard-coded the field name and value to apply to the project. In your implementation, however, you might need to retrieve the available TM fields (if any) from the setup of a selected TM. Fields can be, for example, simple text fields, picklist fields that allow only one or multiple values, etc. The sample code below outlines how to use the TM API functionality to open a file TM (* *.sdltm*) and retrieve the field names and values. After opening the TM, the code loops through all available fields and adds their names to a string variable. If a field is found to be a single or multiple value picklist, the values, too are read and appended to the string variable. You might require such a logic to fill, e.g. a combo list with the names of available fields and values, so that they can be selected by the user at runtime. This functionality may also be relevant for setting project filters (see next chapter, [Translation Memory Filter Settings](translation_memory_filter_settings.md)).
@@ -65,8 +62,7 @@ private void GetTmSetup()
```
***
-See Also
---
+## See Also
[Translation Memory Search Settings](translation_memory_search_settings.md)
[Setting TM Penalties](setting_tm_penalties.md)
diff --git a/apiconcepts/projectautomation/translation_memory_filter_settings.md b/apiconcepts/projectautomation/translation_memory_filter_settings.md
index 3bfef78b58..ffd6b0a1b5 100644
--- a/apiconcepts/projectautomation/translation_memory_filter_settings.md
+++ b/apiconcepts/projectautomation/translation_memory_filter_settings.md
@@ -1,12 +1,10 @@
-Translation Memory Filter Settings
-==
+# Translation Memory Filter Settings
For a project you may also set filters e.g. to 'penalize' translation units if they do not fulfill certain criteria. Example: You want to give preference to translation units that have the TM field value *Type = Technical documentation*. If an exact match is found in the TM, which, however, does not have this field value the match score is reduced by a certain percentage, e.g. from 100% to 99% in order to alert the translator to the fact that it might not fit the current context.
The documentation on the Translation Memory API contains more information on filters. For details please see the following page, which explains how to define filters for TM exports: [Exporting to a TMX File](../../apiconcepts/translationmemory/exporting_to_tmx.md).
-About Filters
---
+## About Filters
The following screenshot illustrates how a filter is defined in the user interface of Var:ProductName:
@@ -25,8 +23,7 @@ Note that for filter penalties you can define multiple filters, whereas hard fil
In this chapter, we will not explain in detail how to use the TM API to create filter expressions. For detailed information, please see [Exporting to a TMX File](../../apiconcepts/translationmemory/exporting_to_tmx.md).
-Defining Filter Penalties
---
+## Defining Filter Penalties
When defining filter penalties apply the [Filters](../../api/projectautomation/Sdl.ProjectAutomation.Settings.TranslationMemorySettings.yml#Sdl_ProjectAutomation_Settings_TranslationMemorySettings_Filters) to the [TranslationMemorySettings](../../api/projectautomation/Sdl.ProjectAutomation.Settings.TranslationMemorySettings.yml) object and set the value to the penalty filters that should be used in the project, i.e.
@@ -53,8 +50,7 @@ tmSettings.Filters.Value = filterList;
```
***
-Defining Hard Filters
---
+## Defining Hard Filters
Defining a hard filter for a project is somewhat easier, as you have to set the [HardFilter](../../api/projectautomation/Sdl.ProjectAutomation.Settings.TranslationMemorySettings.yml#Sdl_ProjectAutomation_Settings_TranslationMemorySettings_HardFilter) property of your [TranslationMemorySettings](../../api/projectautomation/Sdl.ProjectAutomation.Settings.TranslationMemorySettings.yml) object to only one filter expression. The example below outlines how to create the same filter expression as above (i.e. *Type = Technical documentation*), but this time use it as a hard filter:
@@ -68,8 +64,7 @@ tmSettings.HardFilter.Value = hardFilterExpression;
```
***
-See Also
---
+## See Also
[Translation Memory Search Settings](translation_memory_search_settings.md)
[Setting TM Penalties](setting_tm_penalties.md)
diff --git a/apiconcepts/projectautomation/translation_memory_search_settings.md b/apiconcepts/projectautomation/translation_memory_search_settings.md
index 2f4e5d0de0..2934721bb0 100644
--- a/apiconcepts/projectautomation/translation_memory_search_settings.md
+++ b/apiconcepts/projectautomation/translation_memory_search_settings.md
@@ -1,5 +1,4 @@
-Translation Memory Search Settings
-==
+# Translation Memory Search Settings
The most common TM settings are probably the search settings, which you can use to fine-tune TM segment lookup operations as well as concordance searches.
@@ -47,8 +46,7 @@ tmSettings.SourceTrackChangesLookupMode.Value = SourceTrackChangesLookupMode.Loo
```
***
-See Also
---
+## See Also
[Setting TM Penalties](setting_tm_penalties.md)
[Translation Memory Fields Update](translation_memory_field_update.md)
diff --git a/apiconcepts/projectautomation/translation_memory_settings.md b/apiconcepts/projectautomation/translation_memory_settings.md
index 81c0b68e5e..b00d604a21 100644
--- a/apiconcepts/projectautomation/translation_memory_settings.md
+++ b/apiconcepts/projectautomation/translation_memory_settings.md
@@ -1,5 +1,4 @@
-Translation Memory Settings
-==
+# Translation Memory Settings
Through the API you can also fine-tune the translation memory settings for the entire project or for each language pair. Example: The default minimum match value for TM searches is 70%. This means that by default Var:ProductName only offers fuzzy matches if they have a score of 70% or above. Depending on the project (or target language) requirements, however, you may use a lower or a higher minimum fuzzy value.
@@ -31,8 +30,7 @@ project.UpdateSettings(settings);
Note that there is a large number of TM settings available. Some of these settings (e.g. filters) cannot be handled by the Project Automation API alone, but require the Translation Memory API.
-See Also
---
+## See Also
[Translation Memory Search Settings](translation_memory_search_settings.md)
[Setting TM Penalties](setting_tm_penalties.md)
diff --git a/apiconcepts/projectautomation/update_translation_memory_settings.md b/apiconcepts/projectautomation/update_translation_memory_settings.md
index c684fd14e5..d6805c0f81 100644
--- a/apiconcepts/projectautomation/update_translation_memory_settings.md
+++ b/apiconcepts/projectautomation/update_translation_memory_settings.md
@@ -1,5 +1,4 @@
-Update Translation Memory Settings
-==
+# Update Translation Memory Settings
The batch task for updating TMs goes through one or several bilingual (SDLXliff) files and updates one or more TMs using the translated file content. Updating in this case means overwriting existing TUs with edited content from the bilingual files, or adding new TUs, which do not yet exist in the TM(s).
@@ -59,8 +58,7 @@ project.UpdateSettings(settings);
```
***
-Putting it All Together
---
+## Putting it All Together
The function should look as shown below:
@@ -68,16 +66,9 @@ The function should look as shown below:
```CS
public void GetUpdateTmTaskSettings(FileBasedProject project)
{
- #region "UpdateTmTaskSettings"
ISettingsBundle settings = project.GetSettings();
TranslationMemoryUpdateTaskSettings updateTmSettings = settings.GetSettingsGroup();
- #endregion
-
- #region "TargetSegmentsDiffer"
updateTmSettings.TmImportOptions.Value = TmImportOption.MergeTranslation;
- #endregion
-
- #region "Status"
updateTmSettings.UpdateWithApprovedSignOffSegments.Value = true;
updateTmSettings.UpdateWithApprovedTranslationSegments.Value = true;
updateTmSettings.UpdateWithTranslatedSegments.Value = true;
@@ -86,17 +77,12 @@ public void GetUpdateTmTaskSettings(FileBasedProject project)
updateTmSettings.UpdateWithRejectedSignOffSegments.Value = false;
updateTmSettings.UpdateWithRejectedTranslationSegments.Value = false;
updateTmSettings.UpdateWithUnspecifiedSegments.Value = false;
- #endregion
-
- #region "UpdateTaskSettings"
project.UpdateSettings(settings);
- #endregion
}
```
***
-See Also
---
+## See Also
[Analyze Files Settings](analyze_files_settings.md)
[Project TM Creation Settings](project_tm_creation_settings.md)
diff --git a/apiconcepts/projectautomation/updating_project_files.md b/apiconcepts/projectautomation/updating_project_files.md
index c08f151b1a..107f4df4f4 100644
--- a/apiconcepts/projectautomation/updating_project_files.md
+++ b/apiconcepts/projectautomation/updating_project_files.md
@@ -1,5 +1,4 @@
-Updating Project Files
-==
+# Updating Project Files
t is a rather common scenario for files to be updated in the middle of a project. For example, after you have finished creating your project, the customer might send an additional file to the project manager, which needs to be incorporated into the project. Another common use case is that the customer finds out that he/she has sent an outdated source file to the project manager, and therefore provides a more recent version. In this case, the updated file needs to replace the document that is already in the project. Any new or updated files should undergo the same task sequence as the files that are already in the project, e.g. conversion to a translatable format (SDLXliff), file analysis, pre-translation, etc.
@@ -56,8 +55,7 @@ project.AddNewFileVersion(fileId, newFileName);
```
***
-See Also
---
+## See Also
[Adding Files and Folders](adding_files_and_folders.md)
[Adding Files in the Folder to the Project](adding_file_in_the_folder_to_the_project.md)
diff --git a/apiconcepts/projectautomation/viewing_and_deleting_published_projects.md b/apiconcepts/projectautomation/viewing_and_deleting_published_projects.md
index 04fa27940d..c3c83609d3 100644
--- a/apiconcepts/projectautomation/viewing_and_deleting_published_projects.md
+++ b/apiconcepts/projectautomation/viewing_and_deleting_published_projects.md
@@ -1,10 +1,8 @@
-Viewing and Deleting Published Projects
-==
+# Viewing and Deleting Published Projects
As well as allowing you to open a project, the [ProjectServer](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.ProjectServer.yml) class provides methods to view existing projects on the server and delete projects from the server.
-Viewing Server Projects
---
+## Viewing Server Projects
The following example shows how to view all the projects on the project server starting from a particular organization folder including all sub-folders.
@@ -38,8 +36,7 @@ string rootLocalProjectLocation = @"C:\Projects\";
```
***
-Deleting server projects
---
+## Deleting server projects
The following example shows how to delete a project from the project server using the unique id for the project.
@@ -56,8 +53,7 @@ server.DeleteProject(projectId);
>
>This only removes the project from the server and marks the local copy as deleted You can still access the local copy as a local project but any attempt to access the previously attached server will generate an exception
-See Also
---
+## See Also
[About Server Based Projects](about_server_based_projects.md)
[Connecting a Project to a Project Server](connecting_a_project_to_a_project_server.md)
diff --git a/apiconcepts/projectautomation/working_with_project_reports.md b/apiconcepts/projectautomation/working_with_project_reports.md
index 3e11f53b68..27f7a393a8 100644
--- a/apiconcepts/projectautomation/working_with_project_reports.md
+++ b/apiconcepts/projectautomation/working_with_project_reports.md
@@ -1,12 +1,10 @@
-Working with Project Reports
-==
+# Working with Project Reports
In Var:ProductName, the project files have associated a set of predefined reports. The built-in reports are visible in the Reports Viewer. Var:ProductName Reports API allows the 3rd party developers to extend and customize the existing set of reports and display them within an additional Var:ProductName Viewer using a custom developed plugin.
This chapter contains an example of how to add reports to a project programmatically, modify and delete the existing reports and render the reports using Var:ProductName predefined templates or custom templates.
-Getting the Reports list
---
+## Getting the Reports list
To enumerate the reports associated to a project, you need to create a [ProjectReportsOperation](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.Reports.Operations.ProjectReportsOperations.yml) object based on the current project and call [GetProjectReports](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.Reports.Operations.ProjectReportsOperations.yml#Sdl_ProjectAutomation_FileBased_Reports_Operations_ProjectReportsOperations_GetProjectReports) method.
@@ -19,8 +17,7 @@ var reports = new ProjectReportsOperations(fileBasedProject).GetProjectReports()
The method returns a list with report objects.
The report object is used to handle the reports. It contains the report Id, the name, the description, the task template Id, the ISO abbreviation for language, the physical path of the report file, the group, the creation date, the ```isCustomReport``` flag specifying if the report is custom defined or built-in.
-Get the Report definition
---
+## Get the Report definition
To get the report definition, you need to create a [ProjectReportsOperation](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.Reports.Operations.ProjectReportsOperations.yml) object based on the current project and call [GetReportDefinition](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.Reports.Operations.ProjectReportsOperations.yml#Sdl_ProjectAutomation_FileBased_Reports_Operations_ProjectReportsOperations_GetReportDefinition_System_String_) method. This method takes as input parameters the task template Id.
@@ -33,8 +30,7 @@ var reportDefinition = new ProjectReportsOperations(fileBasedProject).GetReportD
The method returns the report definition object.
The report definition contains the task template id, the report Uri, the assembly and the report data.
-Adding a Report
---
+## Adding a Report
To add a report to a project, you need to create a [ProjectReportsOperation](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.Reports.Operations.ProjectReportsOperations.yml) object based on the current project and call [AddReport](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.Reports.Operations.ProjectReportsOperations.yml#Sdl_ProjectAutomation_FileBased_Reports_Operations_ProjectReportsOperations_AddReport_System_String_System_String_System_String_System_String_System_String_) method. This method takes as input parameters the task template Id, the report name, description language and content.
@@ -48,8 +44,7 @@ var addedReport = new ProjectReportsOperations(fileBasedProject)
The method returns the report object.
The method will throw an exception if the task template Id does not exists or the report content is not in xml format.
-Updating a Report
---
+## Updating a Report
To update a report to a project, you need to create a [ProjectReportsOperation](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.Reports.Operations.ProjectReportsOperations.yml) object based on the current project and call [UpdateReport](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.Reports.Operations.ProjectReportsOperations.yml#Sdl_ProjectAutomation_FileBased_Reports_Operations_ProjectReportsOperations_UpdateReport_System_Guid_System_String_System_String_System_String_) method. This method takes as input parameters the task template, the report name, description and content.
@@ -61,8 +56,7 @@ new ProjectReportsOperations(fileBasedProject).UpdateReport("aa84193b-fd88-439c-
The method will throw an exception if the report Id does not exists or the content is not in xml format.
-Deleting Reports
---
+## Deleting Reports
To delete one or more reports from a project, you need to create a [ProjectReportsOperation](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.Reports.Operations.ProjectReportsOperations.yml) object based on the current project and call [RemoveReports](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.Reports.Operations.ProjectReportsOperations.yml#Sdl_ProjectAutomation_FileBased_Reports_Operations_ProjectReportsOperations_RemoveReports_System_Collections_Generic_List_System_Guid__) method. This method takes as input parameters the list with report Ids to be deleted.
@@ -72,8 +66,7 @@ new ProjectReportsOperations(fileBasedProject).RemoveReports(reports.Select(r =>
```
***
-Get the Report Rendering Supported File Formats
---
+## Get the Report Rendering Supported File Formats
To get the supported file formats for rendering a report, you need to create a [ProjectReportsOperation](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.Reports.Operations.ProjectReportsOperations.yml) object based on the current project and call [GetReportRenderingSupportedFileFormats](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.Reports.Operations.ProjectReportsOperations.yml#Sdl_ProjectAutomation_FileBased_Reports_Operations_ProjectReportsOperations_GetReportRenderingSupportedFileFormats_System_Guid_) method. This method takes as input parameter the report Id.
@@ -86,8 +79,7 @@ var reportDefinition = new ProjectReportsOperations(fileBasedProject).GetReportR
The method returns a list with file extensions supported by the rendering engine, such as “xml”, “html”.
The method will throw an exception if the task template Id does not exists.
-Get the Report Rendering
---
+## Get the Report Rendering
To render a report, you need to create a [ProjectReportsOperation](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.Reports.Operations.ProjectReportsOperations.yml) object based on the current project and call one of the 2 [GetReportRendering](../../api/projectautomation/Sdl.ProjectAutomation.FileBased.Reports.Operations.ProjectReportsOperations.yml#Sdl_ProjectAutomation_FileBased_Reports_Operations_ProjectReportsOperations_GetReportRendering_System_Guid_System_String_) overloaded methods.
The first method takes as input parameters the report Id and the output file format.
@@ -114,7 +106,6 @@ The method will throw an exception if the report Id does not exists or the outpu
A Var:ProductName pluggin sample using the Reports API is available for download [here](https://github.com/RWS/Sdl-Community/tree/master/Reports.Viewer.API.Example).
-See Also
---
+## See Also
[Reports Viewer API Example](https://github.com/RWS/Sdl-Community/tree/master/Reports.Viewer.API.Example)