Taşkın Maksim
Taşkın Maksim
<?php
// Get language manager service.
$languageManager = \Drupal::service('language_manager');

//Get the current language code.
$langcode = $languageManager->getCurrentLanguage()->getId();

//Get the current language name.
$langname = $languageManager->getCurrentLanguage()->getName();