config: add REST API Protocol to LanguageTool

Change-Id: I0e05ed89d02a9b467e1707db1638fc9ee554586a
Signed-off-by: Henry Castro <hcastro@collabora.com>
pull/5634/head
Henry Castro 2022-11-22 11:49:22 -04:00 committed by Gökay ŞATIR
parent f7968b4fc1
commit 03365b3aeb
2 changed files with 4 additions and 0 deletions

View File

@ -20,6 +20,7 @@
<user_name desc="LanguageTool account username for premium usage." type="string" default=""></user_name>
<api_key desc="Api key provided by LanguageTool account for premium usage." type="string" default=""></api_key>
<ssl_verification desc="Enable or disable SSL verification" type="string" default="true"></ssl_verification>
<rest_protocol desc="REST API protocol used by LanguageTool" type="string" default=""></rest_protocol>
</languagetool>
<deepl desc="DeepL API settings for translation service">

View File

@ -1995,6 +1995,7 @@ void COOLWSD::innerInitialize(Application& self)
{ "languagetool.user_name", ""},
{ "languagetool.enabled", "false"},
{ "languagetool.ssl_verification", "true"},
{ "languagetool.rest_protocol", ""},
{ "deepl.api_url", ""},
{ "deepl.auth_key", ""},
{ "deepl.enabled", "false"},
@ -2440,6 +2441,8 @@ void COOLWSD::innerInitialize(Application& self)
setenv("LANGUAGETOOL_APIKEY", apiKey.c_str(), 1);
bool sslVerification = getConfigValue<bool>(conf, "languagetool.ssl_verification", "");
setenv("LANGUAGETOOL_SSL_VERIFICATION", sslVerification ? "true" : "false", 1);
const std::string restProtocol = getConfigValue<std::string>(conf, "languagetool.rest_protocol", "");
setenv("LANGUAGETOOL_RESTPROTOCOL", restProtocol.c_str(), 1);
// DeepL configuration
const std::string apiURL = getConfigValue<std::string>(conf, "deepl.api_url", "");