function language_default

7.x bootstrap.inc language_default($property = NULL)
6.x bootstrap.inc language_default($property = NULL)
8.x bootstrap.inc language_default()

Returns the default language used on the site.

Return value

\Drupal\Core\Language\LanguageInterface A language object.

Deprecated

in Drupal 8.x-dev, will be removed before Drupal 8.0. Use \Drupal::languageManager()->getDefaultLanguage().

See also

\Drupal\Core\Language\LanguageManager::getLanguage()

14 calls to language_default()
EmailAction::execute in drupal/core/modules/action/src/Plugin/Action/EmailAction.php
Executes the plugin.
EntityForm::form in drupal/core/lib/Drupal/Core/Entity/EntityForm.php
Returns the actual form array to be built.
ExceptionControllerTest.php in drupal/core/tests/Drupal/Tests/Core/Controller/ExceptionControllerTest.php
Contains \Drupal\Tests\Core\Controller\ExceptionControllerTest
Field::field_langcode in drupal/core/modules/field/src/Plugin/views/field/Field.php
Return the language code of the language the field should be displayed in, according to the settings.
Field::query in drupal/core/modules/field/src/Plugin/views/field/Field.php
Called to add the field to a query.

... See full list

2 string references to 'language_default'
drupal-7.language.database.php in drupal/core/modules/system/tests/upgrade/drupal-7.language.database.php
Database additions for language tests. Used in upgrade.language.test.
ExceptionControllerTest.php in drupal/core/tests/Drupal/Tests/Core/Controller/ExceptionControllerTest.php
Contains \Drupal\Tests\Core\Controller\ExceptionControllerTest

File

drupal/core/includes/bootstrap.inc, line 1335
Functions that need to be loaded on every Drupal request.

Code

function language_default() {
  return \Drupal::languageManager()->getDefaultLanguage();
}