Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.309
diff -u -p -r1.309 bootstrap.inc
--- includes/bootstrap.inc	9 Oct 2009 16:33:13 -0000	1.309
+++ includes/bootstrap.inc	13 Oct 2009 03:19:19 -0000
@@ -1634,7 +1634,7 @@ function drupal_language_initialize() {
     }
   }
   else {
-    include_once DRUPAL_ROOT . '/includes/language.inc';
+    include_once DRUPAL_ROOT . '/' . variable_get('language_inc', 'includes/language.inc');
     foreach ($types as $type) {
       $GLOBALS[$type] = language_initialize($type);
     }
Index: includes/locale.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/locale.inc,v
retrieving revision 1.231
diff -u -p -r1.231 locale.inc
--- includes/locale.inc	9 Oct 2009 16:33:13 -0000	1.231
+++ includes/locale.inc	13 Oct 2009 03:20:33 -0000
@@ -493,7 +493,7 @@ function locale_languages_delete_form_su
  * Setting for language negotiation options
  */
 function locale_languages_configure_form() {
-  include_once DRUPAL_ROOT . '/includes/language.inc';
+  include_once DRUPAL_ROOT . '/' . variable_get('language_inc', 'includes/language.inc');
 
   $form = array(
     '#submit' => array('locale_languages_configure_form_submit'),
Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.352
diff -u -p -r1.352 menu.inc
--- includes/menu.inc	11 Oct 2009 19:39:30 -0000	1.352
+++ includes/menu.inc	13 Oct 2009 03:22:37 -0000
@@ -907,8 +907,8 @@ function menu_tree_all_data($menu_name, 
 
   // Use $mlid as a flag for whether the data being loaded is for the whole tree.
   $mlid = isset($link['mlid']) ? $link['mlid'] : 0;
-  // Generate a cache ID (cid) specific for this $menu_name, $item, and depth.
-  $cid = 'links:' . $menu_name . ':all-cid:' . $mlid . ':' . (int)$max_depth;
+  // Generate a cache ID (cid) specific for this $menu_name, $link, $language, and depth.
+  $cid = 'links:' . $menu_name . ':all-cid:' . $mlid . ':' . $GLOBALS['language_interface']->language . ':' . (int)$max_depth;
 
   if (!isset($tree[$cid])) {
     // If the static variable doesn't have the data, check {cache_menu}.
@@ -926,6 +926,8 @@ function menu_tree_all_data($menu_name, 
       // Build the query using a LEFT JOIN since there is no match in
       // {menu_router} for an external link.
       $query = db_select('menu_links', 'ml', array('fetch' => PDO::FETCH_ASSOC));
+      $query->addTag('translatable');
+      $query->addTag('menu_links');
       $query->leftJoin('menu_router', 'm', 'm.path = ml.router_path');
       $query->fields('ml');
       $query->fields('m', array(
@@ -1018,7 +1020,7 @@ function menu_tree_page_data($menu_name,
       $max_depth = min($max_depth, MENU_MAX_DEPTH);
     }
     // Generate a cache ID (cid) specific for this page.
-    $cid = 'links:' . $menu_name . ':page-cid:' . $item['href'] . ':' . (int)$item['access'] . ':' . (int)$max_depth;
+    $cid = 'links:' . $menu_name . ':page-cid:' . $item['href'] . ':' . $GLOBALS['language_interface']->language . ':' . (int)$item['access'] . ':' . (int)$max_depth;
 
     if (!isset($tree[$cid])) {
       // If the static variable doesn't have the data, check {cache_menu}.
@@ -1109,6 +1111,8 @@ function menu_tree_page_data($menu_name,
         // LEFT JOIN since there is no match in {menu_router} for an external
         // link.
         $query = db_select('menu_links', 'ml', array('fetch' => PDO::FETCH_ASSOC));
+        $query->addTag('translatable');
+        $query->addTag('menu_links');
         $query->leftJoin('menu_router', 'm', 'm.path = ml.router_path');
         $query->fields('ml');
         $query->fields('m', array(
@@ -1164,7 +1168,7 @@ function menu_tree_page_data($menu_name,
  * Helper function - compute the real cache ID for menu tree data.
  */
 function _menu_tree_cid($menu_name, $data) {
-  return 'links:' . $menu_name . ':tree-data:' . md5(serialize($data));
+  return 'links:' . $menu_name . ':tree-data:' . $GLOBALS['language_interface']->language . ':' . md5(serialize($data));
 }
 
 /**
Index: includes/database/select.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database/select.inc,v
retrieving revision 1.24
diff -u -p -r1.24 select.inc
--- includes/database/select.inc	18 Sep 2009 00:04:21 -0000	1.24
+++ includes/database/select.inc	13 Oct 2009 03:22:37 -0000
@@ -1285,6 +1285,11 @@ class SelectQuery extends Query implemen
 
     // FIELDS and EXPRESSIONS
     $fields = array();
+    foreach ($this->tables as $alias => $table) {
+      if (!empty($table['all_fields'])) {
+        $fields[] = $alias . '.*';
+      }
+    }
     foreach ($this->fields as $alias => $field) {
       // Always use the AS keyword for field aliases, as some
       // databases require it (e.g., PostgreSQL).
@@ -1293,11 +1298,6 @@ class SelectQuery extends Query implemen
     foreach ($this->expressions as $alias => $expression) {
       $fields[] = $expression['expression'] . ' AS ' . $expression['alias'];
     }
-    foreach ($this->tables as $alias => $table) {
-      if (!empty($table['all_fields'])) {
-        $fields[] = $alias . '.*';
-      }
-    }
     $query .= implode(', ', $fields);
 
 
Index: modules/contact/contact.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.install,v
retrieving revision 1.20
diff -u -p -r1.20 contact.install
--- modules/contact/contact.install	12 Oct 2009 15:17:51 -0000	1.20
+++ modules/contact/contact.install	13 Oct 2009 03:22:37 -0000
@@ -25,6 +25,7 @@ function contact_schema() {
         'not null' => TRUE,
         'default' => '',
         'description' => 'Category name.',
+        'translatable' => TRUE,
       ),
       'recipients' => array(
         'type' => 'text',
Index: modules/contact/contact.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.pages.inc,v
retrieving revision 1.32
diff -u -p -r1.32 contact.pages.inc
--- modules/contact/contact.pages.inc	11 Oct 2009 18:34:10 -0000	1.32
+++ modules/contact/contact.pages.inc	13 Oct 2009 03:22:37 -0000
@@ -24,7 +24,14 @@ function contact_site_form($form, &$form
   }
 
   // Get an array of the categories and the current default category.
-  $categories = db_query("SELECT cid, category FROM {contact} ORDER BY weight, category")->fetchAllKeyed();
+  $categories = db_select('contact', 'c')
+    ->addTag('translatable')
+    ->addTag('contact')
+    ->fields('c', array('cid', 'category'))
+    ->orderBy('weight')
+    ->orderBy('category')
+    ->execute()
+    ->fetchAllKeyed();
   $default_category = db_query("SELECT cid FROM {contact} WHERE selected = 1")->fetchField();
 
   // If there are no categories, do not display the form.
Index: modules/filter/filter.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.install,v
retrieving revision 1.21
diff -u -p -r1.21 filter.install
--- modules/filter/filter.install	29 Sep 2009 15:13:55 -0000	1.21
+++ modules/filter/filter.install	13 Oct 2009 03:22:37 -0000
@@ -76,6 +76,7 @@ function filter_schema() {
         'not null' => TRUE,
         'default' => '',
         'description' => 'Name of the text format (Filtered HTML).',
+        'translatable' => TRUE,
       ),
       'cache' => array(
         'type' => 'int',
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.296
diff -u -p -r1.296 filter.module
--- modules/filter/filter.module	10 Oct 2009 21:39:02 -0000	1.296
+++ modules/filter/filter.module	13 Oct 2009 03:22:37 -0000
@@ -457,7 +457,13 @@ function filter_formats($account = NULL)
 
   // Statically cache all existing formats upfront.
   if (!isset($formats['all'])) {
-    $formats['all'] = db_query('SELECT * FROM {filter_format} ORDER BY weight')->fetchAllAssoc('format');
+    $formats['all'] = db_select('filter_format', 'ff')
+      ->addTag('translatable')
+      ->addTag('filter_format')
+      ->fields('ff')
+      ->orderBy('weight')
+      ->execute()
+      ->fetchAllAssoc('format');
   }
 
   // Build a list of user-specific formats.
Index: modules/locale/locale.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.install,v
retrieving revision 1.51
diff -u -p -r1.51 locale.install
--- modules/locale/locale.install	11 Oct 2009 11:24:08 -0000	1.51
+++ modules/locale/locale.install	13 Oct 2009 03:20:56 -0000
@@ -45,7 +45,7 @@ function locale_update_7000() {
  * Upgrade language negotiation settings.
  */
 function locale_update_7001() {
-  require_once DRUPAL_ROOT . '/includes/language.inc';
+  require_once DRUPAL_ROOT . '/' . variable_get('language_inc', 'includes/language.inc');
 
   switch (variable_get('language_negotiation', 0)) {
     // LANGUAGE_NEGOTIATION_NONE.
Index: modules/locale/locale.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v
retrieving revision 1.262
diff -u -p -r1.262 locale.module
--- modules/locale/locale.module	10 Oct 2009 16:48:38 -0000	1.262
+++ modules/locale/locale.module	13 Oct 2009 03:21:04 -0000
@@ -750,7 +750,7 @@ function locale_css_alter(&$css) {
  * Implement hook_block_info().
  */
 function locale_block_info() {
-  include_once DRUPAL_ROOT . '/includes/language.inc';
+  include_once DRUPAL_ROOT . '/' . variable_get('language_inc', 'includes/language.inc');
   $block = array();
   $info = language_types_info();
   foreach (language_types_configurable() as $type) {
Index: modules/locale/locale.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.test,v
retrieving revision 1.43
diff -u -p -r1.43 locale.test
--- modules/locale/locale.test	11 Oct 2009 03:07:18 -0000	1.43
+++ modules/locale/locale.test	13 Oct 2009 03:21:15 -0000
@@ -1079,7 +1079,7 @@ class LanguageSwitchingFunctionalTest ex
 
     // Set language negotiation.
     drupal_load('module', 'locale');
-    include_once DRUPAL_ROOT . '/includes/language.inc';
+    include_once DRUPAL_ROOT . '/' . variable_get('language_inc', 'includes/language.inc');
     language_negotiation_set(LANGUAGE_TYPE_CONTENT, locale_language_negotiation_info());
 
     // Assert that the language switching block is displayed on the frontpage.
@@ -1453,7 +1453,7 @@ class UILanguageNegotiationTest extends 
 
   function setUp() {
     parent::setUp('locale', 'locale_test');
-    require_once DRUPAL_ROOT . '/includes/language.inc';
+    require_once DRUPAL_ROOT . '/' . variable_get('language_inc', 'includes/language.inc');
     drupal_load('module', 'locale');
   }
 
Index: modules/menu/menu.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.install,v
retrieving revision 1.21
diff -u -p -r1.21 menu.install
--- modules/menu/menu.install	9 Oct 2009 08:02:24 -0000	1.21
+++ modules/menu/menu.install	13 Oct 2009 03:22:37 -0000
@@ -56,11 +56,13 @@ function menu_schema() {
         'not null' => TRUE,
         'default' => '',
         'description' => 'Menu title; displayed at top of block.',
+        'translatable' => TRUE,
       ),
       'description' => array(
         'type' => 'text',
         'not null' => FALSE,
         'description' => 'Menu description.',
+        'translatable' => TRUE,
       ),
     ),
     'primary key' => array('menu_name'),
Index: modules/menu/menu.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.module,v
retrieving revision 1.209
diff -u -p -r1.209 menu.module
--- modules/menu/menu.module	13 Oct 2009 01:24:07 -0000	1.209
+++ modules/menu/menu.module	13 Oct 2009 03:22:37 -0000
@@ -674,6 +674,8 @@ function menu_node_form_submit($form, &$
 function menu_get_menus($all = TRUE) {
   $system_menus = array_keys(menu_list_system_menus());
   $query = db_select('menu_custom');
+  $query->addTag('translatable');
+  $query->addTag('menu_custom');
   $query->addField('menu_custom', 'menu_name', 'menu_name');
   $query->addField('menu_custom', 'title', 'title');
   if (!$all) {
Index: modules/node/node.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.install,v
retrieving revision 1.33
diff -u -p -r1.33 node.install
--- modules/node/node.install	11 Oct 2009 03:07:18 -0000	1.33
+++ modules/node/node.install	13 Oct 2009 03:22:37 -0000
@@ -269,6 +269,7 @@ function node_schema() {
         'length' => 255,
         'not null' => TRUE,
         'default' => '',
+        'translatable' => TRUE,
       ),
       'base' => array(
         'description' => 'The base string used to construct callbacks corresponding to this node type.',
@@ -281,12 +282,14 @@ function node_schema() {
         'type' => 'text',
         'not null' => TRUE,
         'size' => 'medium',
+        'translatable' => TRUE,
       ),
       'help' => array(
         'description' => 'Help information shown to the user when creating a {node} of this type.',
         'type' => 'text',
         'not null' => TRUE,
         'size' => 'medium',
+        'translatable' => TRUE,
       ),
       'has_title' => array(
         'description' => 'Boolean indicating whether this type uses the {node}.title field.',
@@ -301,6 +304,7 @@ function node_schema() {
         'length' => 255,
         'not null' => TRUE,
         'default' => '',
+        'translatable' => TRUE,
       ),
       'has_body' => array(
         'description' => 'Boolean indicating whether this type has the body field attached.',
@@ -315,6 +319,7 @@ function node_schema() {
         'length' => 255,
         'not null' => TRUE,
         'default' => '',
+        'translatable' => TRUE,
       ),
       'custom' => array(
         'description' => 'A boolean indicating whether this type is defined by a module (FALSE) or by a user via Add content type (TRUE).',
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1145
diff -u -p -r1.1145 node.module
--- modules/node/node.module	11 Oct 2009 03:07:18 -0000	1.1145
+++ modules/node/node.module	13 Oct 2009 03:22:37 -0000
@@ -671,6 +671,8 @@ function _node_types_build() {
     $_node_types->names[$type] = $info['name'];
   }
   $type_result = db_select('node_type', 'nt')
+    ->addTag('translatable')
+    ->addTag('node_type')
     ->fields('nt')
     ->orderBy('nt.type', 'ASC')
     ->addTag('node_type_access')
Index: modules/poll/poll.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.install,v
retrieving revision 1.26
diff -u -p -r1.26 poll.install
--- modules/poll/poll.install	29 Sep 2009 15:13:56 -0000	1.26
+++ modules/poll/poll.install	13 Oct 2009 03:22:37 -0000
@@ -62,6 +62,7 @@ function poll_schema() {
         'not null' => TRUE,
         'default' => '',
         'description' => 'The text for this choice.',
+        'translatable' => TRUE,
       ),
       'chvotes' => array(
         'type' => 'int',
Index: modules/poll/poll.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v
retrieving revision 1.317
diff -u -p -r1.317 poll.module
--- modules/poll/poll.module	11 Oct 2009 03:07:19 -0000	1.317
+++ modules/poll/poll.module	13 Oct 2009 03:22:37 -0000
@@ -438,7 +438,13 @@ function poll_load($nodes) {
     $poll = db_query("SELECT runtime, active FROM {poll} WHERE nid = :nid", array(':nid' => $node->nid))->fetchObject();
 
     // Load the appropriate choices into the $poll object.
-    $poll->choice = db_query("SELECT chid, chtext, chvotes, weight FROM {poll_choice} WHERE nid = :nid ORDER BY weight", array(':nid' => $node->nid))->fetchAllAssoc('chid', PDO::FETCH_ASSOC);
+    $poll->choice = db_select('poll_choice', 'c')
+      ->addTag('translatable')
+      ->addTag('poll_choice')
+      ->fields('c', array('chid', 'chtext', 'chvotes', 'weight'))
+      ->condition('c', 'nid', $node->nid)
+      ->orderBy('weight')
+      ->fetchAllAssoc('chid', PDO::FETCH_ASSOC);
 
     // Determine whether or not this user is allowed to vote.
     $poll->allowvotes = FALSE;
Index: modules/poll/poll.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.pages.inc,v
retrieving revision 1.22
diff -u -p -r1.22 poll.pages.inc
--- modules/poll/poll.pages.inc	11 Oct 2009 03:07:19 -0000	1.22
+++ modules/poll/poll.pages.inc	13 Oct 2009 03:22:38 -0000
@@ -61,6 +61,8 @@ function poll_votes($node) {
   $select->join('poll_choice', 'pc', 'pv.chid = pc.chid');
   $select->join('users', 'u', 'pv.uid = u.uid');
   $queried_votes = $select
+    ->addTag('translatable')
+    ->addTag('poll_choice')
     ->fields('pv', array('chid', 'uid', 'hostname', 'timestamp', 'nid'))
     ->fields('pc', array('chtext'))
     ->fields('u', array('name'))
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.396
diff -u -p -r1.396 system.install
--- modules/system/system.install	12 Oct 2009 15:40:04 -0000	1.396
+++ modules/system/system.install	13 Oct 2009 03:22:38 -0000
@@ -568,6 +568,7 @@ function system_schema() {
         'type' => 'text',
         'not null' => TRUE,
         'size' => 'big',
+        'translatable' => TRUE,
       ),
     ),
     'primary key' => array('name'),
@@ -1069,11 +1070,13 @@ function system_schema() {
         'length' => 255,
         'not null' => TRUE,
         'default' => '',
+        'translatable' => TRUE,
       ),
       'options' => array(
         'description' => 'A serialized array of options to be passed to the url() or l() function, such as a query string or HTML attributes.',
         'type' => 'text',
         'not null' => FALSE,
+        'translatable' => TRUE,
       ),
       'module' => array(
         'description' => 'The name of the module that generated this link.',
Index: modules/taxonomy/taxonomy.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.install,v
retrieving revision 1.24
diff -u -p -r1.24 taxonomy.install
--- modules/taxonomy/taxonomy.install	8 Oct 2009 07:58:47 -0000	1.24
+++ modules/taxonomy/taxonomy.install	13 Oct 2009 03:22:38 -0000
@@ -41,12 +41,14 @@ function taxonomy_schema() {
         'not null' => TRUE,
         'default' => '',
         'description' => 'The term name.',
+        'translatable' => TRUE,
       ),
       'description' => array(
         'type' => 'text',
         'not null' => FALSE,
         'size' => 'big',
         'description' => 'A description of the term.',
+        'translatable' => TRUE,
       ),
       'weight' => array(
         'type' => 'int',
