You are here

function i18n_field_translate_default in Internationalization 7

Translate field default.

2 string references to 'i18n_field_translate_default'
hook_i18n_field_info in i18n_field/i18n_field.api.php
Provide information about callbacks for translating specific field types.
i18n_field_i18n_field_info in i18n_field/i18n_field.i18n.inc
Implements hook_i18n_field_info().

File

i18n_field/i18n_field.module, line 416
Internationalization (i18n) module - Field handling

Code

function i18n_field_translate_default($instance, $value, $langcode = NULL) {

  // The default value does not need sanitizing in a text_textfield widget.
  $sanitize = !($instance['widget']['type'] == 'text_textfield' && $instance['widget']['module'] == 'text');
  return i18n_string_translate(array(
    'field',
    $instance['field_name'],
    $instance['bundle'],
    'default_value',
  ), $value, array(
    'langcode' => $langcode,
    'sanitize' => $sanitize,
  ));
}