Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.217 diff -u -p -r1.217 install.php --- install.php 13 Oct 2009 14:15:08 -0000 1.217 +++ install.php 14 Oct 2009 16:19:53 -0000 @@ -242,12 +242,13 @@ function install_begin_request(&$install require_once DRUPAL_ROOT . '/includes/file.inc'; require_once DRUPAL_ROOT . '/includes/path.inc'; - // Set up $language, so t() caller functions will still work. - drupal_language_initialize(); - // Load module basics (needed for hook invokes). include_once DRUPAL_ROOT . '/includes/module.inc'; include_once DRUPAL_ROOT . '/includes/session.inc'; + + // Set up $language, so t() caller functions will still work. + drupal_language_initialize(); + include_once DRUPAL_ROOT . '/includes/entity.inc'; $module_list['system']['filename'] = 'modules/system/system.module'; $module_list['filter']['filename'] = 'modules/filter/filter.module'; 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 14 Oct 2009 16:18:51 -0000 @@ -1638,6 +1638,9 @@ function drupal_language_initialize() { foreach ($types as $type) { $GLOBALS[$type] = language_initialize($type); } + // Allow modules to react on language system initialization in multilingual + // environments. + module_invoke_all('language_init', $types); } } 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 14 Oct 2009 16:10:13 -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 14 Oct 2009 16:10:13 -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 14 Oct 2009 16:10:13 -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 14 Oct 2009 16:10:13 -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.22 diff -u -p -r1.22 filter.install --- modules/filter/filter.install 13 Oct 2009 15:39:41 -0000 1.22 +++ modules/filter/filter.install 14 Oct 2009 16:10:13 -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.297 diff -u -p -r1.297 filter.module --- modules/filter/filter.module 13 Oct 2009 15:39:41 -0000 1.297 +++ modules/filter/filter.module 14 Oct 2009 16:10:13 -0000 @@ -335,7 +335,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/menu/menu.install =================================================================== RCS file: /cvs/drupal/drupal/modules/menu/menu.install,v retrieving revision 1.22 diff -u -p -r1.22 menu.install --- modules/menu/menu.install 13 Oct 2009 18:36:25 -0000 1.22 +++ modules/menu/menu.install 14 Oct 2009 16:10:13 -0000 @@ -26,11 +26,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 14 Oct 2009 16:10:13 -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 14 Oct 2009 16:10:13 -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 14 Oct 2009 16:10:13 -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 14 Oct 2009 16:10:13 -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 14 Oct 2009 16:10:13 -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 14 Oct 2009 16:10:13 -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.399 diff -u -p -r1.399 system.install --- modules/system/system.install 14 Oct 2009 10:56:35 -0000 1.399 +++ modules/system/system.install 14 Oct 2009 16:10:13 -0000 @@ -568,6 +568,7 @@ function system_schema() { 'type' => 'text', 'not null' => TRUE, 'size' => 'big', + 'translatable' => TRUE, ), ), 'primary key' => array('name'), @@ -1155,11 +1156,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 14 Oct 2009 16:10:13 -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',