You are here

protected function i18n_field_instance::build_properties in Internationalization 7

Get translatable properties

Overrides i18n_string_object_wrapper::build_properties

File

i18n_field/i18n_field.inc, line 141
Field and field instance object handlers

Class

i18n_field_instance
Field instance object

Code

protected function build_properties() {
  $properties = parent::build_properties();
  $object = $this->object;
  $field = field_info_field($object['field_name']);

  // Only for text field types
  if (!empty($object['default_value']) && i18n_field_type_info($field['type'], 'translate_default')) {
    $format = isset($object['default_value'][0]['format']) ? $object['default_value'][0]['format'] : NULL;
    $properties[$this
      ->get_textgroup()][$object['field_name']][$object['bundle']]['default_value']['string'] = $object['default_value'][0]['value'];
    $properties[$this
      ->get_textgroup()][$object['field_name']][$object['bundle']]['default_value']['format'] = $format;
  }
  return $properties;
}