diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 3a54a49..d9db0e2 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -217,11 +217,6 @@ const LANGUAGE_TYPE_CONTENT = 'language_content'; const LANGUAGE_TYPE_INTERFACE = 'language_interface'; /** - * The type of language used for URLs. - */ -const LANGUAGE_TYPE_URL = 'language_url'; - -/** * Language written left to right. Possible value of $language->direction. */ const LANGUAGE_LTR = 0; @@ -2508,7 +2503,6 @@ function drupal_language_initialize() { // @todo Temporary backwards compatibility for code still using globals. // Remove after these issues: // - $language_interface: http://drupal.org/node/1510686 - // - $language_url: http://drupal.org/node/1512310 // - $language_content: http://drupal.org/node/1512308 foreach ($types as $type) { $GLOBALS[$type] = $container->get($type); diff --git a/core/includes/common.inc b/core/includes/common.inc index 353a9b5..dfcc2f3 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -2128,8 +2128,8 @@ function _format_date_callback(array $matches = NULL, $new_langcode = NULL) { * - 'external': Whether the given path is an external URL. * - 'language': An optional language object. If the path being linked to is * internal to the site, $options['language'] is used to look up the alias - * for the URL. If $options['language'] is omitted, the global $language_url - * will be used. + * for the URL. If $options['language'] is omitted, + * drupal_container()->get('language_url') is used instead. * - 'https': Whether this URL should point to a secure location. If not * defined, the current scheme is used, so the user stays on http or https * respectively. TRUE enforces HTTPS and FALSE enforces HTTP, but HTTPS can @@ -2405,7 +2405,7 @@ function l($text, $path, array $options = array()) { // Append active class. if (($path == $_GET['q'] || ($path == '' && drupal_is_front_page())) && - (empty($options['language']) || $options['language']->langcode == drupal_container()->get(LANGUAGE_TYPE_URL)->langcode)) { + (empty($options['language']) || $options['language']->langcode == drupal_container()->get('language_url')->langcode)) { $options['attributes']['class'][] = 'active'; } diff --git a/core/includes/path.inc b/core/includes/path.inc index d6a0201..ad543a4 100644 --- a/core/includes/path.inc +++ b/core/includes/path.inc @@ -73,7 +73,7 @@ function drupal_lookup_path($action, $path = '', $langcode = NULL) { // language. If we used a language different from the one conveyed by the // requested URL, we might end up being unable to check if there is a path // alias matching the URL path. - $langcode = $langcode ? $langcode : drupal_container()->get(LANGUAGE_TYPE_URL)->langcode; + $langcode = $langcode ? $langcode : drupal_container()->get('language_url')->langcode; if ($action == 'wipe') { $cache = array(); diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 5e0a40a..d4cca73 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1693,7 +1693,7 @@ function theme_link($variables) { * http://www.w3.org/TR/WCAG-TECHS/H42.html for more information. */ function theme_links($variables) { - $language_url = drupal_container()->get(LANGUAGE_TYPE_URL); + $language_url = drupal_container()->get('language_url'); $links = $variables['links']; $attributes = $variables['attributes']; diff --git a/core/modules/language/language.module b/core/modules/language/language.module index 34f1a59..bfd7af0 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -287,7 +287,7 @@ function language_language_types_info() { 'description' => t('Order of language detection methods for content. If a version of content is available in the detected language, it will be displayed.'), 'fixed' => array(LANGUAGE_NEGOTIATION_INTERFACE), ), - LANGUAGE_TYPE_URL => array( + 'language_url' => array( 'fixed' => array(LANGUAGE_NEGOTIATION_URL, LANGUAGE_NEGOTIATION_URL_FALLBACK), ), ); @@ -302,7 +302,7 @@ function language_language_negotiation_info() { $negotiation_info = array(); $negotiation_info[LANGUAGE_NEGOTIATION_URL] = array( - 'types' => array(LANGUAGE_TYPE_CONTENT, LANGUAGE_TYPE_INTERFACE, LANGUAGE_TYPE_URL), + 'types' => array(LANGUAGE_TYPE_CONTENT, LANGUAGE_TYPE_INTERFACE, 'language_url'), 'callbacks' => array( 'negotiation' => 'language_from_url', 'language_switch' => 'language_switcher_url', @@ -355,7 +355,7 @@ function language_language_negotiation_info() { ); $negotiation_info[LANGUAGE_NEGOTIATION_URL_FALLBACK] = array( - 'types' => array(LANGUAGE_TYPE_URL), + 'types' => array('language_url'), 'callbacks' => array('negotiation' => 'language_url_fallback'), 'file' => $file, 'weight' => 8, diff --git a/core/modules/locale/locale.test b/core/modules/locale/locale.test index bb3c6e7..663f599 100644 --- a/core/modules/locale/locale.test +++ b/core/modules/locale/locale.test @@ -1615,7 +1615,7 @@ class LocaleUninstallFunctionalTest extends DrupalWebTestCase { variable_set('language_types', language_types_get_default() + array('language_custom' => TRUE)); variable_set('language_negotiation_' . LANGUAGE_TYPE_INTERFACE, language_language_negotiation_info()); variable_set('language_negotiation_' . LANGUAGE_TYPE_CONTENT, language_language_negotiation_info()); - variable_set('language_negotiation_' . LANGUAGE_TYPE_URL, language_language_negotiation_info()); + variable_set('language_negotiation_language_url', language_language_negotiation_info()); // Change language negotiation settings. variable_set('language_negotiation_url_part', LANGUAGE_NEGOTIATION_URL_PREFIX); @@ -1646,7 +1646,7 @@ class LocaleUninstallFunctionalTest extends DrupalWebTestCase { $this->assertTrue($language_negotiation, t('Interface language negotiation: %setting', array('%setting' => t($language_negotiation ? 'none' : 'set')))); $language_negotiation = language_negotiation_method_get_first(LANGUAGE_TYPE_CONTENT) == LANGUAGE_NEGOTIATION_DEFAULT; $this->assertTrue($language_negotiation, t('Content language negotiation: %setting', array('%setting' => t($language_negotiation ? 'none' : 'set')))); - $language_negotiation = language_negotiation_method_get_first(LANGUAGE_TYPE_URL) == LANGUAGE_NEGOTIATION_DEFAULT; + $language_negotiation = language_negotiation_method_get_first('language_url') == LANGUAGE_NEGOTIATION_DEFAULT; $this->assertTrue($language_negotiation, t('URL language negotiation: %setting', array('%setting' => t($language_negotiation ? 'none' : 'set')))); // Check language negotiation method settings.