Closed m9dfukc closed 6 years ago
Replacing the script filter in the workflow with the following should do the trick temporary:
require_once( __DIR__ . '/deepl.php' );
// DE, EN, FR, ES, IT, NL, PL are available
// or use > {LANG_CODE} to force the translation language
$default_language = 'DE';
$deepl = new DeeplTranslate($default_language);
$arg = "{query}";
$arg = str_replace("ä", "ae", $arg);
$arg = str_replace("ü", "ue", $arg);
$arg = str_replace("ö", "oe", $arg);
$arg = str_replace("Ä", "Ae", $arg);
$arg = str_replace("Ü", "Ue", $arg);
$arg = str_replace("Ö", "Oe", $arg);
$arg = str_replace("ß", "ss", $arg);
echo $deepl->translate($arg);
scenario: we wanna translate
gültigkeit
from german to english, the source language should be detected automatically (german) and the default target language is set in our script (english).what happends: the automatic source language detection fails and is set to english (?), as a translation result for
gültigkeit
we getgültigkeit
, so basically the same as the input.what should happen: as a translation result we should get
validity
.what might be the reason: if
gueltigkeit
(ue instead of ü) is the input we wann get translated, the resultvalidity
shows up, thus it seems somehow related to the ü special char character.