function language_test_store_language_negotiation
Same name in other branches
- 9 core/modules/language/tests/language_test/language_test.module \language_test_store_language_negotiation()
- 10 core/modules/language/tests/language_test/language_test.module \language_test_store_language_negotiation()
- 11.x core/modules/language/tests/language_test/language_test.module \language_test_store_language_negotiation()
Store the last negotiated languages.
1 call to language_test_store_language_negotiation()
- language_test_page_top in core/
modules/ language/ tests/ language_test/ language_test.module - Implements hook_page_top().
File
-
core/
modules/ language/ tests/ language_test/ language_test.module, line 70
Code
function language_test_store_language_negotiation() {
$last = [];
foreach (\Drupal::languageManager()->getDefinedLanguageTypes() as $type) {
$last[$type] = \Drupal::languageManager()->getCurrentLanguage($type)
->getId();
}
\Drupal::state()->set('language_test.language_negotiation_last', $last);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.