diff --git a/config/schema/field_group.entity_display.schema.yml b/config/schema/field_group.entity_display.schema.yml index a9fe072..44246ae 100644 --- a/config/schema/field_group.entity_display.schema.yml +++ b/config/schema/field_group.entity_display.schema.yml @@ -12,8 +12,9 @@ core.entity_view_display.*.*.*.third_party.field_group: - type: string label: 'The field name' label: - type: string + type: label label: Readable name of the group + translatable: true parent_name: type: string label: 'The parent group of this group' @@ -43,8 +44,9 @@ core.entity_form_display.*.*.*.third_party.field_group: - type: string label: 'The field name' label: - type: string + type: label label: Readable name of the group + translatable: true region: type: string label: 'The region of this group' diff --git a/includes/field_ui.inc b/includes/field_ui.inc index 10a1f54..75fb26e 100644 --- a/includes/field_ui.inc +++ b/includes/field_ui.inc @@ -161,7 +161,7 @@ function field_group_field_ui_display_form_alter(&$form, FormStateInterface $for '#region_callback' => 'field_group_display_overview_row_region', '#js_settings' => ['rowHandler' => 'group'], 'human_name' => [ - '#markup' => Html::escape(t($group->label)), + '#markup' => Html::escape($group->label), '#prefix' => '', '#suffix' => '', ], diff --git a/src/Plugin/field_group/FieldGroupFormatter/AccordionItem.php b/src/Plugin/field_group/FieldGroupFormatter/AccordionItem.php index 13e6a76..1ca4515 100644 --- a/src/Plugin/field_group/FieldGroupFormatter/AccordionItem.php +++ b/src/Plugin/field_group/FieldGroupFormatter/AccordionItem.php @@ -35,7 +35,7 @@ class AccordionItem extends FieldGroupFormatterBase { '#type' => 'field_group_accordion_item', '#open' => $this->getSetting('formatter') == 'open' ? TRUE : FALSE, '#description' => $this->getSetting('description'), - '#title' => Drupal::translation()->translate($this->getLabel()), + '#title' => Html::escape($this->getLabel()), ]; if ($this->getSetting('id')) { diff --git a/src/Plugin/field_group/FieldGroupFormatter/Details.php b/src/Plugin/field_group/FieldGroupFormatter/Details.php index ca4cd1e..8513ccb 100644 --- a/src/Plugin/field_group/FieldGroupFormatter/Details.php +++ b/src/Plugin/field_group/FieldGroupFormatter/Details.php @@ -28,7 +28,7 @@ class Details extends FieldGroupFormatterBase { $element += [ '#type' => 'details', - '#title' => Html::escape($this->t($this->getLabel())), + '#title' => Html::escape($this->getLabel()), '#open' => $this->getSetting('open') ]; diff --git a/src/Plugin/field_group/FieldGroupFormatter/Fieldset.php b/src/Plugin/field_group/FieldGroupFormatter/Fieldset.php index b9c572c..1b23127 100644 --- a/src/Plugin/field_group/FieldGroupFormatter/Fieldset.php +++ b/src/Plugin/field_group/FieldGroupFormatter/Fieldset.php @@ -27,7 +27,7 @@ class Fieldset extends FieldGroupFormatterBase { $element += [ '#type' => 'fieldset', - '#title' => Html::escape($this->t($this->getLabel())), + '#title' => Html::escape($this->getLabel()), '#pre_render' => [], '#attributes' => [], ]; diff --git a/src/Plugin/field_group/FieldGroupFormatter/HtmlElement.php b/src/Plugin/field_group/FieldGroupFormatter/HtmlElement.php index 714000e..a467058 100644 --- a/src/Plugin/field_group/FieldGroupFormatter/HtmlElement.php +++ b/src/Plugin/field_group/FieldGroupFormatter/HtmlElement.php @@ -68,7 +68,7 @@ class HtmlElement extends FieldGroupFormatterBase { $element['#attributes'] = $element_attributes; if ($this->getSetting('show_label')) { $element['#title_element'] = $this->getSetting('label_element'); - $element['#title'] = Html::escape($this->t($this->getLabel())); + $element['#title'] = Html::escape($this->getLabel()); } $form_state = new FormState(); diff --git a/src/Plugin/field_group/FieldGroupFormatter/Tab.php b/src/Plugin/field_group/FieldGroupFormatter/Tab.php index 58e6d83..1b4798e 100644 --- a/src/Plugin/field_group/FieldGroupFormatter/Tab.php +++ b/src/Plugin/field_group/FieldGroupFormatter/Tab.php @@ -32,7 +32,7 @@ class Tab extends FieldGroupFormatterBase { $add = [ '#type' => 'details', - '#title' => Html::escape($this->t($this->getLabel())), + '#title' => Html::escape($this->getLabel()), '#description' => $this->getSetting('description'), ];