diff --git a/inc/form.class.php b/inc/form.class.php index 8089daef3..8a98e81cc 100644 --- a/inc/form.class.php +++ b/inc/form.class.php @@ -2437,6 +2437,16 @@ public function setTranslations(string $language, array $translations) : bool { return false; } + // CLeanup obsolete strings + $existing_strings = $this->getTranslatableStrings(); + foreach (array_keys($translations) as $original) { + if (!in_array($original, $existing_strings['itemlink']) + && !in_array($original, $existing_strings['string']) + && !in_array($original, $existing_strings['text'])) { + unset($translations[$original]); + } + } + $output = "