You are here

public static function SimplifyingController::getLangcode in Simplifying 8

Simplifying get static pages langcode.

2 calls to SimplifyingController::getLangcode()
SimplifyingController::services in src/Controller/SimplifyingController.php
Simplifying services page.
SimplifyingController::training in src/Controller/SimplifyingController.php
Simplifying training page.

File

src/Controller/SimplifyingController.php, line 39

Class

SimplifyingController

Namespace

Drupal\simplifying\Controller

Code

public static function getLangcode() {
  $lengcode = \Drupal::languageManager()
    ->getCurrentLanguage()
    ->getId();
  if (!in_array($lengcode, [
    'uk',
    'ru',
  ])) {
    $lengcode = 'en';
  }
  return $lengcode;
}