You are here

function entity_translation_unified_form_translate_labels_enabled in Entity Translation Unified Form 8

Returns true if translate labels is enabled for a given bundle.

2 calls to entity_translation_unified_form_translate_labels_enabled()
entity_translation_unified_form_build_field in ./entity_translation_unified_form.module
Create a field definition from the existing one. Checks about the fields should have been done before calling this
entity_translation_unified_form_form_language_content_settings_form_alter in ./entity_translation_unified_form.module
Implements hook_form_form_language_content_settings_form_alter().

File

./entity_translation_unified_form.module, line 261

Code

function entity_translation_unified_form_translate_labels_enabled($entity_type_id, $bundle) {

  /** @var \Drupal\content_translation\ContentTranslationManagerInterface $content_translation_manager */
  $content_translation_manager = \Drupal::service('content_translation.manager');
  if ($content_translation_manager instanceof BundleTranslationSettingsInterface) {
    $settings = $content_translation_manager
      ->getBundleTranslationSettings($entity_type_id, $bundle);
    return !empty($settings['entity_translation_unified_form_translate_labels']);
  }
  return FALSE;
}