diff --git a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
index 04548d9..b4d4023 100644
--- a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
+++ b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
@@ -164,6 +164,10 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
     /** @var \Drupal\link\LinkItemInterface $item */
     $item = $items[$delta];
 
+    // Defines a validation error message to be used in HTML5. It cannot use "%"
+    // placeholder because the markup is output in the popup.
+    $html5_validation_error = t('Enter a full URL, such as "@example".', ['@example' => 'http://example.com']);
+
     $element['uri'] = [
       '#type' => 'url',
       '#title' => $this->t('URL'),
@@ -176,8 +180,10 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
       '#maxlength' => 2048,
       '#required' => $element['#required'],
       '#link_type' => $this->getFieldSetting('link_type'),
-      // Displays a meaningful HTML5 validation error message.
-      '#attributes' => array('oninvalid' => "setCustomValidity('Enter a full URL, such as http://example.com')"),
+      '#attributes' => [
+        // Displays a meaningful HTML5 validation error message.
+        'oninvalid' => "setCustomValidity('" . $html5_validation_error . "')",
+      ],
     ];
 
     // If the field is configured to support internal links, it cannot use the
