File tree Expand file tree Collapse file tree
Open diff view settings
Expand file tree Collapse file tree
Open diff view settings
Original file line number Diff line number Diff line change @@ -356,9 +356,18 @@ public function showTranslations($options = []) {
356356 echo $ header ;
357357 echo '</thead> ' ;
358358
359+ $ all_translated_strings = $ form ->getTranslatableStrings ([
360+ 'translated ' => true ,
361+ 'language ' => $ this ->fields ['name ' ]
362+ ]);
363+
359364 echo '<tbody> ' ;
360365 foreach ($ translations as $ original => $ translated ) {
361366 $ id = PluginFormcreatorTranslation::getTranslatableStringId ($ original );
367+ if (!in_array ($ id , array_keys ($ all_translated_strings ['id ' ]))) {
368+ // String is translated but no longer used in the form or its sub objects
369+ continue ;
370+ }
362371 echo '<tr data-itemtype="PluginFormcreatorTranslation" data-id=" ' . $ id . '"> ' ;
363372 echo '<td> '
364373 . Html::getCheckbox ([
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ public static function getEditorFieldsHtml(PluginFormcreatorForm_Language $formL
161161 if (!isset ($ translatableString ['id ' ][$ id ])) {
162162 // Show nothing if string definitively not found
163163 // Should not happen
164- return '' ;
164+ return '<td colspan="2"> ' . __ ( ' Iternal error : translatable string not found. ' , ' formcreator ' ) . ' </td> ' ; ;
165165 }
166166
167167 $ type = $ translatableString ['id ' ][$ id ] ?? 'string ' ;
You can’t perform that action at this time.
0 commit comments