function LanguageTestHooks::pageTop

Implements hook_page_top().

File

core/modules/language/tests/language_test/src/Hook/LanguageTestHooks.php, line 20

Class

LanguageTestHooks
Hook implementations for language_test.

Namespace

Drupal\language_test\Hook

Code

public function pageTop() {
    if (\Drupal::moduleHandler()->moduleExists('language')) {
        language_test_store_language_negotiation();
        \Drupal::messenger()->addStatus(t('Language negotiation method: @name', [
            '@name' => \Drupal::languageManager()->getNegotiatedLanguageMethod() ?? 'Not defined',
        ]));
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.