function translation_entity_enable

Implements hook_enable().

File

drupal/core/modules/translation_entity/translation_entity.install, line 95
Installation functions for Entity Translation module.

Code

function translation_entity_enable() {

  // Translation works when at least two languages are enabled.
  if (count(language_list()) < 2) {
    $t_args = array(
      '!language_url' => url('admin/config/regional/language'),
    );
    $message = t('Be sure to <a href="!language_url">enable at least two languages</a> to translate content.', $t_args);
    drupal_set_message($message, 'warning');
  }

  // Point the user to the content translation settings.
  $t_args = array(
    '!settings_url' => url('admin/config/regional/content-language'),
  );
  $message = t('<a href="!settings_url">Enable translation</a> for <em>content types</em>, <em>taxonomy vocabularies</em>, <em>accounts</em>, or any other element you wish to translate.', $t_args);
  drupal_set_message($message, 'warning');
}