You are here

function hook_i18n_sync_options in Internationalization 7

Provide information about which fields to synchronize for each entity type.

Field definitions defined on hook_field_info() may contain a synchronization callback used for that field to be synchronized. This callback can be set by: $field['i18n_sync_callback'] = 'sychcronize_function_callback

This callback will be invoked with the following parameters

  • $entity_type, $entity, $field, $instance, $langcode, $items, $source_entity, $source_langcode);

Return value

array Array of fields indexed by field name that will be presented as options to be synchronized. Each element is an array with the following keys:

  • 'title', Field title to be displayed
  • 'description', Field description to be displayed.
  • 'field_name', Field name for configurable Fields.
  • 'group', Group for the UI only to display this field.

See also

i18n_sync_options()

i18n_sync_field_info_alter()

i18n_sync_field_file_sync()

4 functions implement hook_i18n_sync_options()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

book_i18n_sync_options in i18n_sync/i18n_sync.modules.inc
Book module. Implements hook_i18n_sync_options().
comment_i18n_sync_options in i18n_sync/i18n_sync.modules.inc
Comment module. Implements hook_i18n_sync_options().
field_i18n_sync_options in i18n_sync/i18n_sync.modules.inc
Field module. Implements hook_i18n_sync_options().
node_i18n_sync_options in i18n_sync/i18n_sync.modules.inc
Node module. Implements hook_i18n_sync_options().
1 invocation of hook_i18n_sync_options()
i18n_sync_options in i18n_sync/i18n_sync.module
Returns list of available fields for given entity / bundle.

File

i18n_sync/i18n_sync.api.php, line 31
Synchronization API documentation

Code

function hook_i18n_sync_options($entity_type, $bundle_name) {
  if ($entity_type == 'node') {
    return array(
      'parent' => array(
        'title' => t('Book outline'),
        'description' => t('Set the translated parent for each translation if possible.'),
      ),
    );
  }
}