Returns a list of translatable files.
array $data: The data structure.
\Drupal\file\FileInterface[] List of files, keyed by flattened data item key.
public function getTranslatableFiles(array $data) : array {
$files = [];
foreach ($this
->flatten($data) as $key => $item) {
if (isset($item['#file']) && !empty($item['#translate'])) {
$files[$key] = File::load($item['#file']);
}
}
return $files;
}