You are here

public function TranslationLanguageRenderer::getLangcode in Drupal 10

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

File

core/modules/views/src/Entity/Render/TranslationLanguageRenderer.php, line 105

Class

TranslationLanguageRenderer
Renders entity translations in their row language.

Namespace

Drupal\views\Entity\Render

Code

public function getLangcode(ResultRow $row) {
  return $row->{$this->langcodeAlias} ?? $this->languageManager
    ->getDefaultLanguage()
    ->getId();
}