diff --git a/src/libse/AutoTranslate/DeepLTranslate.cs b/src/libse/AutoTranslate/DeepLTranslate.cs
new file mode 100644
index 000000000..9431bcc1f
--- /dev/null
+++ b/src/libse/AutoTranslate/DeepLTranslate.cs
@@ -0,0 +1,132 @@
+using System;
+using System.Collections.Generic;
+using System.Net;
+using System.Net.Http;
+using System.Threading.Tasks;
+using Nikse.SubtitleEdit.Core.Common;
+using Nikse.SubtitleEdit.Core.Translate;
+
+namespace Nikse.SubtitleEdit.Core.AutoTranslate
+{
+ ///
+ /// DeepL Pro V2 translator - see https://www.deepl.com/api.html
+ ///
+ public class DeepLTranslate : IAutoTranslator
+ {
+ private string _apiKey;
+ private string _apiUrl;
+ private string _formality;
+ private HttpClient _client;
+
+ public static string StaticName { get; set; } = "DeepL V2 translate";
+ public string Name => StaticName;
+ public string Url => "https://www.deepl.com";
+ public void Initialize()
+ {
+ _apiKey = Configuration.Settings.Tools.AutoTranslateDeepLApiKey;
+ _apiUrl = Configuration.Settings.Tools.AutoTranslateDeepLUrl;
+ _formality = Configuration.Settings.Tools.AutoTranslateDeepLFormality;
+
+ if (string.IsNullOrEmpty(_apiKey) || string.IsNullOrEmpty(_apiUrl))
+ {
+ return;
+ }
+
+ _client = new HttpClient();
+ _client.BaseAddress = new Uri(_apiUrl.Trim().TrimEnd('/'));
+ _client.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", "DeepL-Auth-Key " + _apiKey.Trim());
+ _formality = string.IsNullOrWhiteSpace(_formality) ? "default" : _formality.Trim();
+ }
+
+ public List GetSupportedSourceLanguages()
+ {
+ return GetTranslationPairs();
+ }
+
+ public List GetSupportedTargetLanguages()
+ {
+ return GetTranslationPairs();
+ }
+
+ public List GetTranslationPairs()
+ {
+ return new List
+ {
+ new TranslationPair("Bulgarian", "bg"),
+ new TranslationPair("Chinese", "zh"),
+ new TranslationPair("Czech", "cs"),
+ new TranslationPair("Danish", "da"),
+ new TranslationPair("Dutch", "nl"),
+ new TranslationPair("English", "en"),
+ new TranslationPair("Estonian", "et"),
+ new TranslationPair("Finnish", "fi"),
+ new TranslationPair("French", "fr"),
+ new TranslationPair("German", "de"),
+ new TranslationPair("Greek", "el"),
+ new TranslationPair("Hungarian", "hu"),
+ new TranslationPair("Indonesian", "id"),
+ new TranslationPair("Italian", "it"),
+ new TranslationPair("Japanese", "ja"),
+ new TranslationPair("Korean", "ko"),
+ new TranslationPair("Latvian", "lv"),
+ new TranslationPair("Lithuanian", "lt"),
+ new TranslationPair("Norwegian (Bokmål)", "nb"),
+ new TranslationPair("Polish", "pl"),
+ new TranslationPair("Portuguese", "pt"),
+ new TranslationPair("Romanian", "ro"),
+ new TranslationPair("Russian", "ru"),
+ new TranslationPair("Slovak", "sk"),
+ new TranslationPair("Slovenian", "sl"),
+ new TranslationPair("Spanish", "es"),
+ new TranslationPair("Swedish", "sv"),
+ new TranslationPair("Turkish", "tr"),
+ new TranslationPair("Ukranian", "uk"),
+ };
+ }
+
+ //public List Translate(string sourceLanguage, string targetLanguage, Paragraph paragraph, StringBuilder log)
+ public Task Translate(string text, string sourceLanguageCode, string targetLanguageCode)
+ {
+ var postContent = new FormUrlEncodedContent(new[]
+ {
+ new KeyValuePair("text", text),
+ new KeyValuePair("target_lang", targetLanguageCode),
+ new KeyValuePair("source_lang", sourceLanguageCode),
+ new KeyValuePair("formality", _formality),
+ });
+ var result = _client.PostAsync("/v2/translate", postContent).Result;
+ var resultContent = result.Content.ReadAsStringAsync().Result;
+ if (result.StatusCode == HttpStatusCode.Forbidden)
+ {
+ throw new Exception("Bad API key");
+ }
+
+ var resultList = new List();
+ var parser = new JsonParser();
+ var x = (Dictionary)parser.Parse(resultContent);
+ foreach (var k in x.Keys)
+ {
+ if (x[k] is List