Setting up the Visual Studio Project |
To start setting up your batch task plug-in project, you need to generate a plug-in that can compile and that implements an empty batch task which can be seen and selected in SDL Trados Studio. For the moment, it will not contain any application logic, that is it will not actually perform a real task.
Assuming that you already installed the SDL Trados Studio SDK, open Microsoft Visual Studio. You will see the following options when you create a new project:
With the above templates you can set up the skeleton of an SDL Trados Studio plug-in project. Select SDL Custom Batch Task Plug-in 2015.The plug-in template will add the required references to your project:
It will also add the following skeleton classes to your project:Open the MyCustomBatchTask.cs class. This class contains the plug-in declaration - the plug-in name and description that will be visible inSDL Trados Studio:
// Plug-in is declared to Studio with is, name and description // Furthermore, you declare the type of file that is processed with this plug-in // This sample plug-in works on bilingual SDL XLIFF files, i.e. not on native source files [AutomaticTask("My_Custom_Batch_Task_ID", "My_Custom_Batch_Task_Name", "My_Custom_Batch_Task_Description", GeneratedFileType = AutomaticTaskFileType.BilingualSource)]
In this class, you also reference the settings page that allows the user to configure the batch tasks settings via the plug-in UI:
// References the settings page, i.e. the UI in which the user can configure plug-in settings [AutomaticTaskSupportedFileType(AutomaticTaskFileType.NativeSource)] [RequiresSettings(typeof(MyCustomBatchTaskSettings), typeof(MyCustomBatchTaskSettingsPage))]
Make sure that you sign your assembly. Then build the assembly. The project is automatically configured to build the plug-in file into the folder: %AppData%\Roaming\SDL\SDL Trados Studio\12\Plugins\Packages\. After you have built the plug-in, you should find the file SDL Custom Batch Task Plug-in 2015.sdlplugin. Now start SDL Trados Studio. Because the plug-in is not yet officially signed by SDL, you will see the following message after you start the application:
For the moment, ignore this message. Click Yes to make sure that SDL Trados Studio extracts the plug-in file. Once Studio is started, you should find the sub-folder SDL Custom Batch Task Plug-in 2015 under %AppData%\Roaming\SDL\SDL Trados Studio\12\Plugins\Unpacked\. This sub-folder contains the unpacked plug-in assemblies.In the batch tasks list of SDL Trados Studio, you will see the name of your newly compiled plug-in:
When you select your sample batch task you will see the following window with the plug-in description:
At this point your batch task is not actually doing anything, but as a first step you have managed to integrate your plug-in into SDL Trados Studio. In the following pages, we will enhance this basic plug-in with some added functionality. Close SDL Trados Studio and go back to your Microsoft Visual Studio project.