Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By plach on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
The available languages list provided by _locale_get_predefined_list()
can now be obtained through the language manager:
D7
<?php
require_once DRUPAL_ROOT . '/includes/iso.inc';
$languages = _locale_get_predefined_list();
?>
D8
<?php
use Drupal\Core\Language\LanguageManager;
$languages = LanguageManager::getStandardLanguageList();
?>
This obsoletes https://drupal.org/node/1276626.
Impacts:
Module developers