You are here

function entity_translation_settings in Entity Translation 7

Return the entity translation settings for the given entity type and bundle.

5 calls to entity_translation_settings()
EntityTranslationDefaultHandler::entityFormLanguageWidget in includes/translation.handler.inc
EntityTranslationDefaultHandler::getSharedFieldsAccess in includes/translation.handler.inc
entity_translation_admin_form in ./entity_translation.admin.inc
Builder function for the entity translation settings form.
entity_translation_field_extra_fields in ./entity_translation.module
Implements hook_field_extra_fields().
entity_translation_settings_init in ./entity_translation.admin.inc
Applies the given settings to every defined bundle.

File

./entity_translation.module, line 1825

Code

function entity_translation_settings($entity_type, $bundle) {
  $settings = variable_get('entity_translation_settings_' . $entity_type . '__' . $bundle, array());
  if (empty($settings)) {
    $info = entity_get_info($entity_type);
    if (!empty($info['translation']['entity_translation']['default settings'])) {
      $settings = $info['translation']['entity_translation']['default settings'];
    }
  }
  $settings += array(
    'default_language' => ENTITY_TRANSLATION_LANGUAGE_DEFAULT,
    'hide_language_selector' => TRUE,
    'exclude_language_none' => FALSE,
    'lock_language' => FALSE,
    'shared_fields_original_only' => FALSE,
  );
  return $settings;
}