Skip to content
Snippets Groups Projects

Resolve #3512774 "Add translation support"

1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
+ 2
2
@@ -67,7 +67,7 @@ function link_text_options_field_widget_single_element_link_default_form_alter(a
@@ -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']);
$options = link_text_options_get_allowed_values($context['widget']);
if (count($options)) {
if (count($options)) {
if (count($options) === 1) {
if (count($options) === 1) {
$element['title']['#default_value'] = $options[0];
$element['title']['#default_value'] = t($options[0]);
$element['title']['#disabled'] = TRUE;
$element['title']['#disabled'] = TRUE;
if (!$element['#required']) {
if (!$element['#required']) {
// Remove the state that forces the URI to required of title set.
// 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
@@ -83,7 +83,7 @@ function link_text_options_field_widget_single_element_link_default_form_alter(a
}
}
else {
else {
$element['title']['#type'] = 'select';
$element['title']['#type'] = 'select';
$element['title']['#options'] = array_combine($options, $options);
$element['title']['#options'] = array_map('t', array_combine($options, $options));
}
}
}
}
}
}
Loading