public static function SingleVariationWidget::removeTranslatabilityClue in Commerce Core 8.2
After-build callback for removing the translatability clue from the widget.
The variations field is not translatable, to avoid different translations having different references. However, that causes ContentTranslationHandler to add an "(all languages)" suffix to the widget title. That suffix is incorrect, since the content_entity inline form does ensure that specific entity translations are being edited.
See also
ContentTranslationHandler::addTranslatabilityClue()
File
- modules/
product/ src/ Plugin/ Field/ FieldWidget/ SingleVariationWidget.php, line 141
Class
- SingleVariationWidget
- Plugin implementation of the 'commerce_product_single_variation' widget.
Namespace
Drupal\commerce_product\Plugin\Field\FieldWidgetCode
public static function removeTranslatabilityClue(array $element, FormStateInterface $form_state) {
$element['#title'] = $element['#field_title'];
return $element;
}