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_show: if the language element is hidden or not.
13 calls to language_get_default_configuration()
CustomBlockTypeFormController::form in drupal/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php
Overrides \Drupal\Core\Entity\EntityFormController::form().
EntityTranslationSettingsTest::testSettingsUI in drupal/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationSettingsTest.php
Tests that the settings UI works as expected.
hook_field_extra_fields in drupal/core/modules/field/field.api.php
Exposes "pseudo-field" components on fieldable entities.
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.

... See full list

File

drupal/core/modules/language/language.module, line 370
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_show' => FALSE,
  );
  return $configuration;
}