? comment-body-support.patch
? etid.patch
? untranslated-fields.patch
Index: translation.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/translation/translation.install,v
retrieving revision 1.2
diff -u -p -r1.2 translation.install
--- translation.install	3 Oct 2010 16:36:14 -0000	1.2
+++ translation.install	20 Dec 2010 16:17:49 -0000
@@ -42,11 +42,12 @@ function translation_schema() {
   $schema['translation'] = array(
     'description' => 'Table to track entity translations',
     'fields' => array(
-      'etid' => array(
-        'type' => 'int',
-        'unsigned' => TRUE,
+      'entity_type' => array(
+        'type' => 'varchar',
+        'length' => 128,
         'not null' => TRUE,
-        'description' => 'The entity type id this translation relates to',
+        'default' => '',
+        'description' => 'The entity type this translation relates to',
       ),
       'entity_id' => array(
         'type' => 'int',
@@ -100,7 +101,7 @@ function translation_schema() {
         'default' => 0,
       ),
     ),
-    'primary key' => array('etid', 'entity_id', 'language'),
+    'primary key' => array('entity_type', 'entity_id', 'language'),
   );
 
   return $schema;
Index: includes/translation.handler.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/translation/includes/translation.handler.inc,v
retrieving revision 1.3
diff -u -p -r1.3 translation.handler.inc
--- includes/translation.handler.inc	3 Oct 2010 16:36:14 -0000	1.3
+++ includes/translation.handler.inc	20 Dec 2010 16:17:50 -0000
@@ -200,7 +200,6 @@ class TranslationDefaultHandler implemen
    * Read the translation data from the storage.
    */
   public static function loadMultiple($entity_type, $entities) {
-    $etid = _field_sql_storage_etid($entity_type);
     $entity_info = entity_get_info($entity_type);
     $translations_key = $entity_info['entity keys']['translations'];
 
@@ -210,7 +209,7 @@ class TranslationDefaultHandler implemen
 
     $results = db_select('translation', 'et')
       ->fields('et')
-      ->condition('etid', $etid)
+      ->condition('entity_type', $entity_type)
       ->condition('entity_id', array_keys($entities), 'IN')
       ->orderBy('entity_id')
       ->orderBy('created')
@@ -237,11 +236,9 @@ class TranslationDefaultHandler implemen
   }
 
   public function saveTranslations() {
-    $etid = $this->getEtid();
-
     // Delete and insert, rather than update, in case a value was added.
     db_delete('translation')
-      ->condition('etid', $etid)
+      ->condition('entity_type', $this->entityType)
       ->condition('entity_id', $this->entityId)
       ->execute();
 
@@ -250,12 +247,12 @@ class TranslationDefaultHandler implemen
     if (count($translations->data)) {
       global $user;
 
-      $columns = array('etid', 'entity_id', 'language', 'source', 'uid', 'status', 'translate', 'created', 'changed');
+      $columns = array('entity_type', 'entity_id', 'language', 'source', 'uid', 'status', 'translate', 'created', 'changed');
       $query = db_insert('translation')->fields($columns);
 
       foreach ($translations->data as $langcode => $translation) {
         $translation += array(
-          'etid' => $etid,
+          'entity_type' => $this->entityType,
           'entity_id' => $this->entityId,
           'source' => '',
           'uid' => $user->uid,
@@ -485,15 +482,6 @@ class TranslationDefaultHandler implemen
   }
 
   /**
-   * Return the entity type identifier.
-   */
-  protected function getEtid() {
-    // @todo: Consider avoiding the use of a field SQL storage function to
-    // identify the entity: we might have different storage engines.
-    return _field_sql_storage_etid($this->entityType);
-  }
-
-  /**
    * Return an instance of the given path.
    *
    * @param $path
