You are here

function field_is_translatable in Drupal 7

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

3 calls to field_is_translatable()
comment_submit in modules/comment/comment.module
Prepare a comment for submission.
field_available_languages in modules/field/field.multilingual.inc
Collects the available languages for the given entity type and field.
LocaleCommentLanguageFunctionalTest::setUp in modules/locale/locale.test
Sets up a Drupal site for running functional and integration tests.

File

modules/field/field.multilingual.inc, line 175
Functions implementing Field API multilingual support.

Code

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