Same name and namespace in other branches
  1. 10 core/modules/language/language.api.php \hook_language_types_info()
  2. 8.9.x core/modules/language/language.api.php \hook_language_types_info()
  3. 9 core/modules/language/language.api.php \hook_language_types_info()

Define language types.

Return value

An associative array of language type definitions. The keys are the identifiers, which are also used as names for global variables representing the types in the bootstrap phase. The values are associative arrays that may contain the following elements:

  • name: The human-readable language type identifier.
  • description: A description of the language type.
  • fixed: A fixed array of language negotiation provider identifiers to use to initialize this language. Defining this key makes the language type non-configurable, so it will always use the specified providers in the given priority order. Omit to make the language type configurable.

See also

hook_language_types_info_alter()

Related topics

2 functions implement hook_language_types_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

locale_language_types_info in modules/locale/locale.module
Implements hook_language_types_info().
locale_test_language_types_info in modules/locale/tests/locale_test.module
Implements hook_language_types_info().
1 invocation of hook_language_types_info()
language_types_info in includes/language.inc
Returns all the defined language types.

File

modules/system/language.api.php, line 82
Hooks provided by the base system for language support.

Code

function hook_language_types_info() {
  return array(
    'custom_language_type' => array(
      'name' => t('Custom language'),
      'description' => t('A custom language type.'),
    ),
    'fixed_custom_language_type' => array(
      'fixed' => array(
        'custom_language_provider',
      ),
    ),
  );
}