You are here

public function CitationStyler::getLanguageCode in Bibliography & Citation 2.0.x

Same name and namespace in other branches
  1. 8 src/CitationStyler.php \Drupal\bibcite\CitationStyler::getLanguageCode()

Get current used language code.

Return value

string Current language code.

Overrides CitationStylerInterface::getLanguageCode

1 call to CitationStyler::getLanguageCode()
CitationStyler::render in src/CitationStyler.php
Render CSL data to bibliographic citation.

File

src/CitationStyler.php, line 171

Class

CitationStyler
Render CSL data to bibliographic citation.

Namespace

Drupal\bibcite

Code

public function getLanguageCode() {
  if (!$this->langCode) {
    $this->langCode = $this->languageManager
      ->getCurrentLanguage()
      ->getId();
  }
  return $this->langCode;
}