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

7 calls to field_is_translatable()
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 \Drupal\Core\TypedData\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.
FieldTranslationSynchronizer::synchronizeFields in drupal/core/modules/translation_entity/lib/Drupal/translation_entity/FieldTranslationSynchronizer.php
Performs field column synchronization on the given entity.

... See full list

File

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

Code

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