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

2 calls to field_is_translatable()
comment_submit in modules/comment/comment.module
Prepare a comment for submission.
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);
}