You are here

function _biblio_localize_fields in Bibliography Module 6.2

Same name and namespace in other branches
  1. 6 biblio.module \_biblio_localize_fields()
  2. 7 biblio.module \_biblio_localize_fields()
  3. 7.2 biblio.module \_biblio_localize_fields()

Translates interface field titles and hints.

If the i18nstrings module is enabled, this function translates field titles and hints through the interface translation system.

Parameters

array $fields: An associative array with field information (passed by reference) keyed by field ID number with two elements:

  • title: A string with the title of the field.
  • hint: A string with the hint text for the field.
3 calls to _biblio_localize_fields()
biblio_form in ./biblio.module
Implements hook_form().
theme_biblio_tabular in includes/biblio_theme.inc
_biblio_content_extra_fields in includes/content.biblio.inc
Creates additional form fields for the biblio content type.

File

./biblio.module, line 117
Main file for Drupal module biblio.

Code

function _biblio_localize_fields(&$fields) {
  if (module_exists('i18nstrings')) {
    foreach ($fields as $key => $row) {
      if (isset($row['ftdid'])) {
        $fields[$key]['title'] = tt("biblio:field:{$row['ftdid']}:title", $fields[$key]['title']);
        $fields[$key]['hint'] = tt("biblio:field:{$row['ftdid']}:hint", $fields[$key]['hint']);
      }
    }
  }
}