Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.340 diff -u -p -r1.340 bootstrap.inc --- includes/bootstrap.inc 7 Jan 2010 04:54:18 -0000 1.340 +++ includes/bootstrap.inc 13 Jan 2010 09:30:30 -0000 @@ -1786,8 +1786,8 @@ function drupal_language_initialize() { */ function drupal_language_types() { return array( - LANGUAGE_TYPE_CONTENT => TRUE, LANGUAGE_TYPE_INTERFACE => TRUE, + LANGUAGE_TYPE_CONTENT => FALSE, LANGUAGE_TYPE_URL => FALSE, ); } Index: includes/locale.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/locale.inc,v retrieving revision 1.241 diff -u -p -r1.241 locale.inc --- includes/locale.inc 8 Jan 2010 13:32:43 -0000 1.241 +++ includes/locale.inc 13 Jan 2010 09:30:30 -0000 @@ -46,9 +46,9 @@ define('LOCALE_LANGUAGE_NEGOTIATION_URL_ * @return * The current content language code. */ -function locale_language_from_content() { - global $language; - return isset($language->language) ? $language->language : FALSE; +function locale_language_from_interface() { + global $language_interface; + return isset($language_interface->language) ? $language_interface->language : FALSE; } /** Index: modules/locale/locale.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.admin.inc,v retrieving revision 1.1 diff -u -p -r1.1 locale.admin.inc --- modules/locale/locale.admin.inc 8 Jan 2010 13:32:43 -0000 1.1 +++ modules/locale/locale.admin.inc 13 Jan 2010 14:30:52 -0000 @@ -476,11 +476,19 @@ function locale_languages_delete_form_su function locale_languages_configure_form() { include_once DRUPAL_ROOT . '/includes/language.inc'; + $configurable_types = array(); + $language_types_info = language_types_info(); + foreach ($language_types_info as $type => $info) { + if (!isset($info['fixed'])) { + $configurable_types[] = $type; + } + } + $form = array( '#submit' => array('locale_languages_configure_form_submit'), '#theme' => 'locale_languages_configure_form', - '#language_types' => language_types_configurable(), - '#language_types_info' => language_types_info(), + '#language_types' => $configurable_types, + '#language_types_info' => $language_types_info, '#language_providers' => language_negotiation_info(), ); Index: modules/locale/locale.module =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v retrieving revision 1.281 diff -u -p -r1.281 locale.module --- modules/locale/locale.module 10 Jan 2010 19:06:47 -0000 1.281 +++ modules/locale/locale.module 13 Jan 2010 14:27:32 -0000 @@ -24,9 +24,9 @@ define('LOCALE_LANGUAGE_NEGOTIATION_URL' define('LOCALE_LANGUAGE_NEGOTIATION_BROWSER', 'locale-browser'); /** - * The language is determined using the current content language. + * The language is determined using the current interface language. */ -define('LOCALE_LANGUAGE_NEGOTIATION_CONTENT', 'locale-content'); +define('LOCALE_LANGUAGE_NEGOTIATION_INTERFACE', 'locale-interface'); /** * The language is set based on the user language settings. @@ -69,7 +69,7 @@ function locale_help($path, $arg) { case 'admin/config/regional/language/add': return '

' . t('Add all languages to be supported by your site. If your desired language is not available in the Language name drop-down, click Custom language and provide a language code and other details manually. When providing a language code manually, be sure to enter a standardized language code, since this code may be used by browsers to determine an appropriate display language.') . '

'; case 'admin/config/regional/language/configure': - $output = '

' . t("Set which languages to use for content and for the administrative interface. Drag the detection methods into the order they should test for languages. The first method that gets a result will set the language for the relevant part of the site. Changing these settings may break all incoming URLs, use with caution in a production environment.") . '

'; + $output = '

' . t("Set how system languages should be determined. Drag the detection methods into the order they should test for languages. The first method that gets a result will set the language for the relevant part of the site. Changing these settings may break all incoming URLs, use with caution in a production environment.") . '

'; return $output; case 'admin/config/regional/language/configure/url': $output = '

' . t('Determine the language by examining the URL. Example: "http://example.com/de/contact" sets language to German based on the use of "de" as the path prefix. "http://de.example.com/contact" sets presentation language to German based on the use of "http://de.example.com" in the domain.') . '

'; @@ -482,14 +482,13 @@ function locale_entity_info_alter(&$enti */ function locale_language_types_info() { return array( - LANGUAGE_TYPE_CONTENT => array( - 'name' => t('Content'), - 'description' => t('If a piece of content is available in multiple languages, the one matching the content language will be used.'), - ), LANGUAGE_TYPE_INTERFACE => array( 'name' => t('Interface'), 'description' => t('The interface labels will be displayed in the interface language.'), ), + LANGUAGE_TYPE_CONTENT => array( + 'fixed' => array(LOCALE_LANGUAGE_NEGOTIATION_INTERFACE), + ), LANGUAGE_TYPE_URL => array( 'fixed' => array(LOCALE_LANGUAGE_NEGOTIATION_URL), ), @@ -547,13 +546,13 @@ function locale_language_negotiation_inf 'description' => t('The language is determined from the browser\'s language settings.'), ); - $providers[LOCALE_LANGUAGE_NEGOTIATION_CONTENT] = array( - 'types' => array(LANGUAGE_TYPE_INTERFACE), - 'callbacks' => array('language' => 'locale_language_from_content'), + $providers[LOCALE_LANGUAGE_NEGOTIATION_INTERFACE] = array( + 'types' => array(LANGUAGE_TYPE_CONTENT), + 'callbacks' => array('language' => 'locale_language_from_interface'), 'file' => $file, 'weight' => 8, - 'name' => t('Content'), - 'description' => t('The interface language is the same as the negotiated content language.'), + 'name' => t('Interface'), + 'description' => t('The content language is the same as the negotiated interface language.'), ); return $providers; Index: modules/locale/locale.test =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.test,v retrieving revision 1.60 diff -u -p -r1.60 locale.test --- modules/locale/locale.test 10 Jan 2010 22:56:51 -0000 1.60 +++ modules/locale/locale.test 13 Jan 2010 09:40:47 -0000 @@ -1122,7 +1122,7 @@ class LanguageSwitchingFunctionalTest ex function testLanguageBlock() { // Enable the language switching block. $edit = array( - 'locale_language[region]' => 'sidebar_first', + 'locale_language_interface[region]' => 'sidebar_first', ); $this->drupalPost('admin/structure/block', $edit, t('Save blocks')); @@ -1135,14 +1135,14 @@ class LanguageSwitchingFunctionalTest ex // Set language negotiation. drupal_load('module', 'locale'); include_once DRUPAL_ROOT . '/includes/language.inc'; - language_negotiation_set(LANGUAGE_TYPE_CONTENT, locale_language_negotiation_info()); + language_negotiation_set(LANGUAGE_TYPE_INTERFACE, locale_language_negotiation_info()); // Assert that the language switching block is displayed on the frontpage. $this->drupalGet(''); $this->assertText(t('Languages'), t('Language switcher block found.')); // Assert that only the current language is marked as active. - list($language_switcher) = $this->xpath('//div[@id="block-locale-language"]/div[@class="content"]'); + list($language_switcher) = $this->xpath('//div[@id="block-locale-language_interface"]/div[@class="content"]'); $links = array( 'active' => array(), 'inactive' => array(), @@ -1815,7 +1815,6 @@ class LocalizeDateFormatsFunctionalTest // Set language negotiation. $edit = array( - 'language[enabled][locale-url]' => TRUE, 'language_interface[enabled][locale-url]' => TRUE, ); $this->drupalPost('admin/config/regional/language/configure', $edit, t('Save settings')); Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.1212 diff -u -p -r1.1212 node.module --- modules/node/node.module 13 Jan 2010 12:58:47 -0000 1.1212 +++ modules/node/node.module 13 Jan 2010 13:39:05 -0000 @@ -1250,52 +1250,6 @@ function node_build_content($node, $view } /** - * Implements hook_language_negotiation_info(). - */ -function node_language_negotiation_info() { - $providers = array(); - - $providers['node-language'] = array( - 'types' => array(LANGUAGE_TYPE_CONTENT), - 'callbacks' => array('language' => 'node_language_provider'), - 'file' => drupal_get_path('module', 'node') . '/node.module', - 'name' => t('Node'), - 'description' => t('The current node language is used.'), - ); - - return $providers; -} - -/** - * Return the language of the current node. - * - * @param $languages - * An array of valid language objects. - * - * @return - * A valid language code on succes, FALSE otherwise. - */ -function node_language_provider($languages) { - require_once DRUPAL_ROOT . '/' . variable_get('path_inc', 'includes/path.inc'); - - $path = isset($_GET['q']) ? $_GET['q'] : ''; - list($language, $path) = language_url_split_prefix($path, $languages); - $language = $language ? $language : language_default(); - $path = drupal_get_normal_path($path, $language->language); - - // We cannot use args now. - $path = explode('/', $path); - // Act only if we are in a node page. - if (isset($path[0]) && isset($path[1]) && $path[0] == 'node' && $nid = intval($path[1])) { - // We cannot perform a node load here. - $result = db_query('SELECT n.language FROM {node} n WHERE n.nid = :nid', array(':nid' => $nid))->fetchAssoc(); - return $result['language']; - } - - return FALSE; -} - -/** * Generate an array which displays a node detail page. * * @param $node