function language_default

Returns the default language, as an object, or one of its properties.

Parameters

$property: (optional) The property of the language object to return.

Return value

Either the language object for the default language used on the site, or the property of that object named in the $property parameter.

26 calls to language_default()
contact_site_form_submit in drupal/modules/contact/contact.pages.inc
Form submission handler for contact_site_form().
DrupalUnitTestCase::setUp in drupal/modules/simpletest/drupal_web_test_case.php
Sets up unit test environment.
DrupalWebTestCase::setUp in drupal/modules/simpletest/drupal_web_test_case.php
Sets up a Drupal site for running functional and integration tests.
drupal_language_initialize in drupal/includes/bootstrap.inc
Initializes all the defined language types.
field_valid_language in drupal/modules/field/field.multilingual.inc
Ensures that a given language code is valid.

... See full list

9 string references to 'language_default'
DrupalUnitTestCase::setUp in drupal/modules/simpletest/drupal_web_test_case.php
Sets up unit test environment.
DrupalWebTestCase::prepareEnvironment in drupal/modules/simpletest/drupal_web_test_case.php
Prepares the current environment for running the test.
LocaleUILanguageNegotiationTest::testUILanguageNegotiation in drupal/modules/locale/locale.test
Tests for language switching by URL path.
locale_add_language in drupal/includes/locale.inc
API function to add a language.
locale_languages_edit_form_submit in drupal/modules/locale/locale.admin.inc
Process the language editing form submission.

... See full list

File

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

Code

function language_default($property = NULL) {
  $language = variable_get('language_default', (object) array(
    'language' => 'en',
    'name' => 'English',
    'native' => 'English',
    'direction' => 0,
    'enabled' => 1,
    'plurals' => 0,
    'formula' => '',
    'domain' => '',
    'prefix' => '',
    'weight' => 0,
    'javascript' => '',
  ));
  return $property ? $language->{$property} : $language;
}