You are here

protected function i18n_field::build_properties in Internationalization 7

Get translatable properties

Overrides i18n_string_object_wrapper::build_properties

File

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

Class

i18n_field
Field object

Code

protected function build_properties() {
  $properties = parent::build_properties();
  $object = $this->object;

  // For select fields field:field_name
  if (!empty($object['settings']['allowed_values']) && i18n_field_type_info($object['type'], 'translate_options')) {

    //return array('field', $field['field_name'], '#allowed_values');
    foreach ($object['settings']['allowed_values'] as $key => $value) {
      $properties[$this
        ->get_textgroup()][$object['field_name']]['#allowed_values'][$key] = array(
        'title' => t('Option %name', array(
          '%name' => $value,
        )),
        'string' => $value,
      );
    }
  }
  return $properties;
}