You are here

protected function i18n_field::translate_field in Internationalization 7

Set field translation for object.

Mot often, this is a direct field set, but sometimes fields may have different formats.

Parameters

$object: A clone of the object or array. Field instance.

Overrides i18n_string_object_wrapper::translate_field

File

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

Class

i18n_field
Field object

Code

protected function translate_field(&$object, $i18nstring, $langcode, $options) {
  if ($i18nstring->objectid == '#allowed_values') {
    $object['settings']['#allowed_values'][$i18nstring->key] = $i18nstring
      ->format_translation($langcode, $options);
  }
  else {
    parent::translate_field($object, $i18nstring, $langcode, $options);
  }
}