Entity Translation for custom entity I've created a custom entity and in the next step, I would like to use the Entity Translation module to make the entity translatable.

My entity is defined like this

/**
 * Implements hook_entity_info().
 */
function MY_MODULE_entity_info() {
  $info['custom_entity'] = array(
    'label' =&gt; t('Custom Entity'),
    'base table' =&gt; 'custom_entity',
    'module' =&gt; 'MY_MODULE',
    'uri callback' =&gt; 'custom_entity_basic_uri',
    'controller class' =&gt; 'EntityCustomController',
    'fieldable' =&gt; TRUE,
    'entity keys' =&gt; array(
      'id' =&gt; 'qid',
      'label' =&gt; 'title',
    ),
    'translation' =&gt; array(
      'entity_translation' =&gt; array(
        'default settings' =&gt; array(
          'default_language' =&gt; 'de',
        ),
        'base path' =&gt; 'my-path/%custom_entity',
        'view path' =&gt; 'my-path/%custom_entity',
        'edit path' =&gt; 'admin/my-path/%custom_entity/edit',
        'translate path' =&gt; 'my-path/%custom_entity/translate',
        'path wildcard' =&gt; '%custom_entity',
      ),
    ),
    'static cache' =&gt; FALSE,
    'bundles' =&gt; array(
      'custom_entity' =&gt; array(
        'label' =&gt; 'Custom bundle',
        'admin' =&gt; array(
          'path' =&gt; 'admin/structure/custom/manage',
          'access arguments' =&gt; array('administer custom entities'),
        ),
      ),
    ),
    'view modes' =&gt; array(
      'full' =&gt; array(
        'label' =&gt; t('Full'),
        'custom settings' =&gt; FALSE,
      ),
    ),
  );
  return $info;
}


With this definition, my custom entity appears in the Entity Translation admin view (admin/config/regional/entity_translation) and I can configure it. This seems to be correct, because in the 'manage field' tab, the language selector field appears and the 'translate' tab appears also in the edit form.

The only strange thing I found is that the language selector is not rendered in the edit form in any time. If I save the translation, the source entity is overriden with the changes, but no translation is added.

I thought the problem is my Controller class, but this seems to work correctly too:

class EntityCustomController extends EntityAPIControllerExportable {
  public function create(array $values = array()) {
    $values += array(
      'created' =&gt; REQUEST_TIME,
      'type' =&gt; 'custom_entity',
      'qid' =&gt; 0,
      'bundle_type' =&gt; 'custom_entity',
      'title' =&gt; '',
    );
    return parent::create($values);
  }

  /**
   * Save Task Type.
   */
  public function save($entity, DatabaseTransaction $transaction = NULL) {
    parent::save($entity, $transaction);
  }

}


In my custom edit form, I use field_attach_form function to render all the defined themes.

And, if it helps, this is my save handler:

/**
 * Save entity by using the controller.
 */
function MY_MODULE_custom_entity_save(&amp;$entity) {
  return entity_get_controller('custom_entity')-&gt;save($entity);
}
In my case the issue ended up being pretty simple to fix. I found that the function entity_translation_form_alter() was testing to see if my entity's edit form was suitable for alteration. My edit form failed the very first test because entity_translation_edit_form_info() was returning false.

entity_translation_edit_form_info() was returning false because my form didn't have $form_state[$entity_info['translation']['entity_translation']['edit form']] set and set to the entity I was trying to edit.

tl;dr: Make sure you set a value in your edit form's $form_state at the path you declare in the edit form element of the settings array for your entity returned by your implementation of hook_entity_info().