1 locale.module locale_language_types_info()

Implements hook_language_types_info().

Defines the three core language types:

  • Interface language is the only configurable language type in core. It is used by t() as the default language if none is specified.
  • Content language is by default non-configurable and inherits the interface language negotiated value. It is used by the Field API to determine the display language for fields if no explicit value is specified.
  • URL language is by default non-configurable and is determined through the URL language provider or the URL fallback provider if no language can be detected. It is used by l() as the default language if none is specified.

File

core/modules/locale/locale.module, line 343
Add language handling functionality and enables the translation of the user interface to languages other than English.

Code

function locale_language_types_info() {
  require_once BACKDROP_ROOT . '/core/includes/locale.inc';
  return array(
    LANGUAGE_TYPE_INTERFACE => array(
      'name' => t('User interface text'),
      'description' => t('Order of language detection methods for user interface text. If a translation of user interface text is available in the detected language, it will be displayed.'),
    ),
    LANGUAGE_TYPE_CONTENT => array(
      'name' => t('Content'),
      'description' => t('Order of language detection methods for content. If a version of content is available in the detected language, it will be displayed.'),
      'fixed' => array(LANGUAGE_NEGOTIATION_INTERFACE),
    ),
    LANGUAGE_TYPE_URL => array(
      'fixed' => array(LANGUAGE_NEGOTIATION_URL, LANGUAGE_NEGOTIATION_URL_FALLBACK),
    ),
  );
}