File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -356,9 +356,18 @@ public function showTranslations($options = []) {
356
356
echo $ header ;
357
357
echo '</thead> ' ;
358
358
359
+ $ all_translated_strings = $ form ->getTranslatableStrings ([
360
+ 'translated ' => true ,
361
+ 'language ' => $ this ->fields ['name ' ]
362
+ ]);
363
+
359
364
echo '<tbody> ' ;
360
365
foreach ($ translations as $ original => $ translated ) {
361
366
$ 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
+ }
362
371
echo '<tr data-itemtype="PluginFormcreatorTranslation" data-id=" ' . $ id . '"> ' ;
363
372
echo '<td> '
364
373
. Html::getCheckbox ([
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ public static function getEditorFieldsHtml(PluginFormcreatorForm_Language $formL
161
161
if (!isset ($ translatableString ['id ' ][$ id ])) {
162
162
// Show nothing if string definitively not found
163
163
// Should not happen
164
- return '' ;
164
+ return '<td colspan="2"> ' . __ ( ' Iternal error : translatable string not found. ' , ' formcreator ' ) . ' </td> ' ; ;
165
165
}
166
166
167
167
$ type = $ translatableString ['id ' ][$ id ] ?? 'string ' ;
You can’t perform that action at this time.
0 commit comments