function translation_entity_permission

Implements hook_permission().

File

drupal/core/modules/translation_entity/translation_entity.module, line 392
Allows entities to be translated into different languages.

Code

function translation_entity_permission() {
  $permission = array(
    'edit original values' => array(
      'title' => t('Edit original values'),
      'description' => t('Access the entity form in the original language.'),
    ),
    'toggle field translatability' => array(
      'title' => t('Toggle field translatability'),
      'description' => t('Toggle translatability of fields performing a bulk update.'),
    ),
    'translate any entity' => array(
      'title' => t('Translate any entity'),
      'description' => t('Translate field content for any fieldable entity.'),
    ),
  );
  foreach (entity_get_info() as $entity_type => $info) {
    if (translation_entity_enabled($entity_type)) {
      $label = !empty($info['label']) ? t($info['label']) : $entity_type;
      $permission["translate {$entity_type} entities"] = array(
        'title' => t('Translate entities of type @type', array(
          '@type' => $label,
        )),
        'description' => t('Translate field content for entities of type @type.', array(
          '@type' => $label,
        )),
      );
    }
  }
  return $permission;
}