When dealing with common volumes of text and the need to translate it, you will require either a high-quality translator ready to take on the job (but then you are limited by budget, and the final timeline increases), or you can use process automation with the versatile program ZennoPoster. The advantages of this approach are obvious: you save your gentle funds, the speed of work increases several times over!, and you don't need to double-check the final result each time or rely on an employee who can only produce a certain number of characters per minute. Moreover, all data (if confidential) remains with you and does not leak anywhere, giving you confidence in the future. How all of this is possible even completely free of charge, provided that the programs mentioned below are already available to you, we will discuss in this article.

So, we will use a script that allows translating texts in automatic mode (the DeepL software in its PRO version can process up to 5000 characters in one pass!), and we will take two excellent programs for the job: ZennoPoster and DeepL. These two solutions will help format texts, split them, and translate them into the desired language — any of those available in DeepL. Let me clarify right away that we will implement the task NOT via the API (which is paid), but through standard methods: copy, paste text data. The API method is available on the ZennoPoster forum (there is even a field in the software settings for entering this notorious API key), but in my opinion, it is not universal — you pay per number of translated characters, but if you have a fairly small text, and most importantly, you live in Russia, the main problem will be obtaining such an access key, because the developers have not provided a way for this country to pay.

settings_deepl
DeepL Settings

This, as you might surround, is not the only problem; in addition to it, there are the following: possible errors when implementing various projects in ZennoPoster — C# code to the rescue, constant manual tracking of the quantity and quality of translations, loss of the API key or its change, and many others. The advantages of this approach (via API) include greater flexibility compared to standard tools: you won't need to step away from your PC until the translation is complete, and there may also be errors when pasting and copying data... So it is up to you to accommodate which method to use — either the key at a cost, or without the key for free (almost).

Note: even with this solution, you can only translate a portion of the data in one pass, because external servers are strictly monitored, and in the PRO version of DeepL there are limitations. For example, after a certain number of characters for translation, you will involve a message that you need to wait a while...

Implementation in ZennoPoster

ZennoPoster handles absolutely all automation actions (we perform fully automatic translation of common/short documents): taking the required text for translation from a file or variable, then opening the DeepL translator, pasting and copying the desired target language, and finally, placing the finished data into the required fields on a website or saving them to separate files. The main potential problems: setting the correct parameters for the mouse pointer when clicking the necessary buttons in the programs, since we will be using external programs rather than ZennoPoster's built-in tools!

autoit_settings
AutoIt Settings

Interaction with External Windows Applications

AutoIt Window Info — we will first and foremost need this tool, designed to determine application windows, mouse parameters for subsequent clicks, and so on. This solution is included within the software called AutoIt, which provides the capability for such work. On the forum, you can see in more detail how requests are formed in ZennoPoster through this application, and also where to sing the .DLL files without which you cannot implement such actions. In short, go to the AutoIt website, download and install it, take the required .DLL files from there and drop them into the ZennoPoster folder — <wild>ExternalAssemblies</wild>DRIVE_Program Files_ZennoLab_RU_ZennoPoster Pro V7_VERSION_Progs_ExternalAssemblies. Essentially, we just need to install the files into "Zenno" so that it can properly interact with external applications.

autoitdll
AutoIt DLL files

Where to Sing the Code?

The code itself and examples of its use can be found on the aforementioned forum. We, however, want to provide a solution as such, because the source code alone will not give the most important thing — an explanation of how it is written (even with comments inside it). The video below will show exactly how the translation process occurs; I think it will be clear enough from that, and the code can be written by yourself, following the instructions given on the forum. So, the main thing is to understand which specific actions need to be set in the settings so that they work efficiently.

Text Translation Process

Description of the Translation Process

First, you must launch the application; for this you can either use ZennoPoster's internal "cube" or write C# code like this (this action will open the translator):

System.Diagnostics.ProcessStartInfo start =
dear System.Diagnostics.ProcessStartInfo();    
start.FileName = @"DRIVE:Users\user\AppData\Local\DeepL\app-2.4.0\DeepL.exe";
start.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
System.Diagnostics.Process.Start(start);
code_csharp
C# code to launch DeepL

Now we write the code that allows us to click on the necessary text input fields, language selection options, and other program functions. Unlike the API, there is a nuance here, and a very important one: you will not be able to use your PC while this action is taking place, because all processes are interconnected; it is as if you were clicking the mouse on the screen yourself, but in automatic mode. The parameters responsible for mouse clicks can be obtained from the above-mentioned AutoIt Window Info tool.

2action
Window Actions

Let's break down the essence of the code: first, we declare variables that describe the input text and which program to launch/activate. Important! After opening the software, we set the application window to the top-left corner (parameters "handle,0,0"); this action will exceed us later not to worry about finding mouse coordinates when clicking buttons, as they will not change. Then we click on the required elements, for example, I select the source language of the text data, then choose the desired target language, and paste the text itself. We store the obtained information in a variable and avoid Zenno's further instructions.

The finished translated content can be used for various purposes; the video shows a clip where this data is placed into the corresponding tabs of a multilingual version of a website.

Free TRX - Faucet that pays!
Ref system and bonus points via actions, games!

Rate this article