From adc50e30dddcc8f713472ebffff4f14f10c82706 Mon Sep 17 00:00:00 2001
From: Alejandro Bonilla <jabonillac@gmail.com>
Date: Thu, 13 Mar 2025 09:53:18 -0400
Subject: [PATCH] Add translation base support [ISSUE-3512774].

---
 link_text_options.module | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/link_text_options.module b/link_text_options.module
index 2be7879..83bed55 100644
--- a/link_text_options.module
+++ b/link_text_options.module
@@ -67,7 +67,7 @@ function link_text_options_field_widget_single_element_link_default_form_alter(a
   $options = link_text_options_get_allowed_values($context['widget']);
   if (count($options)) {
     if (count($options) === 1) {
-      $element['title']['#default_value'] = $options[0];
+      $element['title']['#default_value'] = t($options[0]);
       $element['title']['#disabled'] = TRUE;
       if (!$element['#required']) {
         // Remove the state that forces the URI to required of title set.
@@ -83,7 +83,7 @@ function link_text_options_field_widget_single_element_link_default_form_alter(a
     }
     else {
       $element['title']['#type'] = 'select';
-      $element['title']['#options'] = array_combine($options, $options);
+      $element['title']['#options'] = array_map('t', array_combine($options, $options));
     }
   }
 }
-- 
GitLab