Fixed source culture for DeepL service
This commit is contained in:
parent
1393d703a1
commit
a179e8dd23
@ -52,6 +52,9 @@ public static class DeepL
|
|||||||
var sourceCultureIndex = await AppSettings.GetDeepLSourceCultureIndex();
|
var sourceCultureIndex = await AppSettings.GetDeepLSourceCultureIndex();
|
||||||
var sourceCulture = await AppSettings.GetCultureCode(sourceCultureIndex);
|
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);
|
using var deepl = new Translator(deepLAPIKey);
|
||||||
var translation = await deepl.TranslateTextAsync(text, sourceCulture, targetCulture);
|
var translation = await deepl.TranslateTextAsync(text, sourceCulture, targetCulture);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user