You are here

public function DefaultLanguageRenderer::getLangcode in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Entity/Render/DefaultLanguageRenderer.php \Drupal\views\Entity\Render\DefaultLanguageRenderer::getLangcode()

Returns the language code associated with the given row.

Parameters

\Drupal\views\ResultRow $row: The result row.

Return value

string A language code.

Overrides EntityTranslationRendererBase::getLangcode

File

core/modules/views/src/Entity/Render/DefaultLanguageRenderer.php, line 15

Class

DefaultLanguageRenderer
Renders entities in their default language.

Namespace

Drupal\views\Entity\Render

Code

public function getLangcode(ResultRow $row) {
  return $row->_entity
    ->getUntranslated()
    ->language()
    ->getId();
}