You are here

function _name_translations in Name Field 7

Same name and namespace in other branches
  1. 8 name.module \_name_translations()
  2. 6 name.module \_name_translations()

Static cache to reuse translated name components.

These have double encoding to allow easy and targeted string overrides in the sites settings.php file.

26 calls to _name_translations()
name_autocomplete in ./name.admin.inc
Menu callback for the name autocomplete.
name_element_expand in ./name.module
The #process callback to create the element.
name_element_info in ./name.module
Implements hook_element_info().
name_element_pre_render in ./name.module
This function themes the element and controls the title display.
name_element_validate in ./name.module
A custom validator to check the components of a name_element element.

... See full list

File

./name.module, line 358
Defines an API for displaying and inputing names.

Code

function _name_translations($intersect = NULL) {
  static $nt = NULL;
  if (!isset($nt)) {
    $nt = variable_get('name_field_part_overrides', 0);
    if (!$nt) {
      $nt = array(
        'title' => t('!name_title', array(
          '!name_title' => t('Title'),
        )),
        'given' => t('!name_given', array(
          '!name_given' => t('Given'),
        )),
        'middle' => t('!name_middle', array(
          '!name_middle' => t('Middle name(s)'),
        )),
        'family' => t('!name_family', array(
          '!name_family' => t('Family'),
        )),
        'generational' => t('!name_generational', array(
          '!name_generational' => t('Generational'),
        )),
        'credentials' => t('!name_credentials', array(
          '!name_credentials' => t('Credentials'),
        )),
      );
    }
  }
  return empty($intersect) ? $nt : array_intersect_key($nt, $intersect);
}