function language_get_default_configuration

Returns the language configuration stored for an entity type and bundle.

Parameters

string $entity_type: A string representing the entity type.

string $bundle: A string representing the bundle.

Return value

array An array with the following keys:

  • langcode: the language code.
  • language_hidden: if the language element is hidden or not.
9 calls to language_get_default_configuration()
LanguageConfigurationElementTest::testLanguageConfigurationElement in drupal/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationElementTest.php
Tests the language settings have been saved.
LanguageConfigurationElementTest::testNodeTypeUpdate in drupal/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationElementTest.php
Tests that the configuration is updated when the node type is changed.
language_elements_configuration_element in drupal/core/modules/language/tests/language_elements_test/language_elements_test.module
A form containing a language configuration element.
language_get_default_langcode in drupal/core/modules/language/language.module
Returns the default language code assigned to an entity type and a bundle.
language_node_type_update in drupal/core/modules/language/language.module
Implements hook_node_type_update().

... See full list

File

drupal/core/modules/language/language.module, line 351
Add language handling functionality to Drupal.

Code

function language_get_default_configuration($entity_type, $bundle) {
  $configuration = config('language.settings')
    ->get(language_get_default_configuration_settings_key($entity_type, $bundle));
  if (is_null($configuration)) {
    $configuration = array();
  }
  $configuration += array(
    'langcode' => 'site_default',
    'language_hidden' => TRUE,
  );
  return $configuration;
}