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() : void {
    if (\Drupal::moduleHandler()->moduleExists('language')) {
        $this->storeLanguageNegotiation();
        \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.