Fixed source culture for DeepL service

This commit is contained in:
tsommer committed 2022-09-21 19:56:50 +02:00
1 parent 1393d703a1
commit a179e8dd23
1 file changed
+3
+3
View File
@@ -52,6 +52,9 @@ public static class DeepL
var sourceCultureIndex = await AppSettings.GetDeepLSourceCultureIndex();
var sourceCulture = await AppSettings.GetCultureCode(sourceCultureIndex);
// In case of the source culture, we cannot specify the region, so we need to remove it:
sourceCulture = sourceCulture.Split('-')[0];
using var deepl = new Translator(deepLAPIKey);
var translation = await deepl.TranslateTextAsync(text, sourceCulture, targetCulture);