Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

As part of a bigger effort to make the language related APIs cleaner, the language table schema as well as resulting objects now use the 'langcode' property to designate the language code used and not the 'language' property. This makes it easier to tell whether you face an object or a string if an object property or array key is named 'language'. The change is being applied to other areas of Drupal in other issues tagged with 'langcode'. See the list of those issues at http://drupal.org/project/issues/search/drupal?issue_tags=langcode

Drupal 6/7:

<?php
$languages
= language_list();
foreach (
$languages as $language) {
 
// Will print the language code of the language as configured in locale.module.
 
print $language->language;
}
?>

Drupal 8

<?php
$languages
= language_list();
foreach (
$languages as $language) {
 
// Will print the language code of the language as configured in language.module.
 
print $language->langcode;
}
// The code change makes it very clear whether you deal with a language code or a
//  language object. (language_load() introduced in Drupal 8).
$language = language_load($langcode);
print
$language->langcode;
?>

For themers, the main page wrappers changed. Drupal implements html.tpl.php in Drupal 8 so that you don't need to deal with language directly anymore. It is already taken care for you. As of the time of this writing, the maintenance page template and the book export template did deal with HTML root tag attributes directly. For those, printing the language code is now done with $language->langcode and not $language->language in concert with what was written above:

Drupal 7 maintenance-page.tpl.php snippet:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">

Drupal 8 maintenance-page.tpl.php snippet:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->langcode ?>" lang="<?php print $language->langcode ?>" dir="<?php print $language->dir ?>">

There is a fair chance that these templates will adapt the more automated approach used in html.tpl.php later in the Drupal 8 development cycle and you don't need to deal with language codes directly anymore. Consult more up to date documentation at that point.

Impacts: 
Module developers
Themers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done