diff --git a/backend/src/Squidex.Infrastructure/Translations/DeepLTranslator.cs b/backend/src/Squidex.Infrastructure/Translations/DeepLTranslator.cs index 8428a1587..461211e17 100644 --- a/backend/src/Squidex.Infrastructure/Translations/DeepLTranslator.cs +++ b/backend/src/Squidex.Infrastructure/Translations/DeepLTranslator.cs @@ -23,7 +23,7 @@ namespace Squidex.Infrastructure.Translations { private const string Url = "https://api.deepl.com/v2/translate"; private readonly HttpClient httpClient = new HttpClient(); - private readonly DeepLTranslatorOptions deepLOptions; + private readonly DeepLTranslatorOptions deeplOptions; private readonly IJsonSerializer jsonSerializer; private sealed class Response @@ -36,12 +36,12 @@ namespace Squidex.Infrastructure.Translations public string Text { get; set; } } - public DeepLTranslator(IOptions deepLOptions, IJsonSerializer jsonSerializer) + public DeepLTranslator(IOptions deeplOptions, IJsonSerializer jsonSerializer) { - Guard.NotNull(deepLOptions); + Guard.NotNull(deeplOptions); Guard.NotNull(jsonSerializer); - this.deepLOptions = deepLOptions.Value; + this.deeplOptions = deeplOptions.Value; this.jsonSerializer = jsonSerializer; } @@ -53,14 +53,14 @@ namespace Squidex.Infrastructure.Translations return new Translation(TranslationResult.NotTranslated, sourceText); } - if (string.IsNullOrWhiteSpace(deepLOptions.AuthKey)) + if (string.IsNullOrWhiteSpace(deeplOptions.AuthKey)) { return new Translation(TranslationResult.NotImplemented); } var parameters = new Dictionary { - ["auth_key"] = deepLOptions.AuthKey, + ["auth_key"] = deeplOptions.AuthKey, ["text"] = sourceText, ["target_lang"] = GetLanguageCode(targetLanguage) }; diff --git a/backend/src/Squidex/appsettings.json b/backend/src/Squidex/appsettings.json index f9c925269..05362c7e3 100644 --- a/backend/src/Squidex/appsettings.json +++ b/backend/src/Squidex/appsettings.json @@ -534,7 +534,9 @@ /* * The deepl api key if you want to support automated translations. */ - "deeplAuthKey": "" + "deepl": { + "authKey": "" + } }, "rebuild": {