Commit 1f3142df authored by catch's avatar catch

Issue #1539622 by cosmicdreams: Modify locale module to use dependency injection for language.

parent f54e6e38
......@@ -1587,7 +1587,7 @@ class LocaleUninstallFunctionalTest extends WebTestBase {
// Check the UI language.
drupal_language_initialize();
$this->assertEqual($GLOBALS['language_interface']->langcode, $this->langcode, t('Current language: %lang', array('%lang' => $GLOBALS['language_interface']->langcode)));
$this->assertEqual(drupal_container()->get(LANGUAGE_TYPE_INTERFACE)->langcode, $this->langcode, t('Current language: %lang', array('%lang' => drupal_container()->get(LANGUAGE_TYPE_INTERFACE)->langcode)));
// Enable multilingual workflow option for articles.
variable_set('node_type_language_article', 1);
......@@ -1632,7 +1632,7 @@ class LocaleUninstallFunctionalTest extends WebTestBase {
// Check the init language logic.
drupal_language_initialize();
$this->assertEqual($GLOBALS['language_interface']->langcode, 'en', t('Language after uninstall: %lang', array('%lang' => $GLOBALS['language_interface']->langcode)));
$this->assertEqual(drupal_container()->get(LANGUAGE_TYPE_INTERFACE)->langcode, 'en', t('Language after uninstall: %lang', array('%lang' => drupal_container()->get(LANGUAGE_TYPE_INTERFACE)->langcode)));
// Check JavaScript files deletion.
$this->assertTrue($result = !file_exists($js_file), t('JavaScript file deleted: %file', array('%file' => $result ? $js_file : t('found'))));
......
......@@ -22,8 +22,8 @@ function locale_test_boot() {
*/
function locale_test_init() {
locale_test_store_language_negotiation();
if (isset($GLOBALS['language_interface']) && isset($GLOBALS['language_interface']->method_id)) {
drupal_set_message(t('Language negotiation method: @name', array('@name' => $GLOBALS['language_interface']->method_id)));
if (isset(drupal_container()->get(LANGUAGE_TYPE_INTERFACE)->langcode) && isset(drupal_container()->get(LANGUAGE_TYPE_INTERFACE)->method_id)) {
drupal_set_message(t('Language negotiation method: @name', array('@name' => drupal_container()->get(LANGUAGE_TYPE_INTERFACE)->method_id)));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment