Short snippet to get the enabled languages programmatically

$langcodes = \Drupal::languageManager()->getLanguages();
$langcodesList = array_keys($langcodes);

 


Saved you some valuable time?

Donate and get more free time-saving code on this website in the future.