diff --git a/core/modules/content_translation/src/ContentTranslationHandler.php b/core/modules/content_translation/src/ContentTranslationHandler.php
index 7bacd9379cbba231ab201efd58d39b03ad160d8c..24caa245c7c4874f449a8cbb86f6307ec7c8f2c1 100644
--- a/core/modules/content_translation/src/ContentTranslationHandler.php
+++ b/core/modules/content_translation/src/ContentTranslationHandler.php
@@ -563,21 +563,13 @@ public function entityFormAlter(array &$form, FormStateInterface $form_state, En
    *
    * @see \Drupal\content_translation\ContentTranslationHandler::entityFormAlter()
    */
-  public function entityFormSharedElements(array $element, FormStateInterface $form_state, $form) {
+  public function entityFormSharedElements($element, FormStateInterface $form_state, $form) {
     static $ignored_types;
 
     // @todo Find a more reliable way to determine if a form element concerns a
     //   multilingual value.
     if (!isset($ignored_types)) {
-      $ignored_types = array_flip([
-        'actions',
-        'value',
-        'hidden',
-        'vertical_tabs',
-        'token',
-        'details',
-        'link',
-      ]);
+      $ignored_types = array_flip(['actions', 'value', 'hidden', 'vertical_tabs', 'token', 'details', 'link']);
     }
 
     /** @var \Drupal\Core\Entity\ContentEntityForm $form_object */
@@ -598,30 +590,31 @@ public function entityFormSharedElements(array $element, FormStateInterface $for
       if (!isset($element[$key]['#type'])) {
         $this->entityFormSharedElements($element[$key], $form_state, $form);
       }
-      // Ignore non-widget form elements.
-      if (isset($ignored_types[$element[$key]['#type']])) {
-        continue;
-      }
-      // Elements are considered to be non-multilingual by default.
-      if (!empty($element[$key]['#multilingual'])) {
-        continue;
-      }
-      // If we are displaying a multilingual entity form we need to provide
-      // translatability clues, otherwise the non-multilingual form elements
-      // should be hidden.
-      if (!$translation_form) {
-        if ($display_translatability_clue) {
-          $this->addTranslatabilityClue($element[$key]);
+      else {
+        // Ignore non-widget form elements.
+        if (isset($ignored_types[$element[$key]['#type']])) {
+          continue;
         }
-        // Hide widgets for untranslatable fields.
-        if ($hide_untranslatable_fields && isset($field_definitions[$key])) {
-          $element[$key]['#access'] = FALSE;
-          $display_warning = TRUE;
+        // Elements are considered to be non multilingual by default.
+        if (empty($element[$key]['#multilingual'])) {
+          // If we are displaying a multilingual entity form we need to provide
+          // translatability clues, otherwise the non-multilingual form elements
+          // should be hidden.
+          if (!$translation_form) {
+            if ($display_translatability_clue) {
+              $this->addTranslatabilityClue($element[$key]);
+            }
+            // Hide widgets for untranslatable fields.
+            if ($hide_untranslatable_fields && isset($field_definitions[$key])) {
+              $element[$key]['#access'] = FALSE;
+              $display_warning = TRUE;
+            }
+          }
+          else {
+            $element[$key]['#access'] = FALSE;
+          }
         }
       }
-      else {
-        $element[$key]['#access'] = FALSE;
-      }
     }
 
     if ($display_warning && !$form_state->isSubmitted() && !$form_state->isRebuilding()) {