function field_is_translatable

Checks whether a field has language support.

A field has language support enabled if its 'translatable' property is set to TRUE, and its entity type has at least one translation handler registered.

Parameters

$entity_type: The type of the entity the field is attached to.

$field: A field data structure.

Return value

TRUE if the field can be translated.

Related topics

6 calls to field_is_translatable()
CommentFormController::submit in drupal/core/modules/comment/lib/Drupal/comment/CommentFormController.php
Overrides Drupal\Core\Entity\EntityFormController::submit().
CommentLanguageTest::setUp in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php
Sets up a Drupal site for running functional and integration tests.
Entity::getTranslationLanguages in drupal/core/lib/Drupal/Core/Entity/Entity.php
Implements TranslatableInterface::getTranslationLanguages().
Field::field_langcode in drupal/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php
Return the language code of the language the field should be displayed in, according to the settings.
Field::query in drupal/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php
Called to add the field to a query.

... See full list

File

drupal/core/modules/field/field.multilingual.inc, line 208
Functions implementing Field API multilingual support.

Code

function field_is_translatable($entity_type, $field) {
  return $field['translatable'] && field_has_translation_handler($entity_type);
}