1 |
85ad3d82
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
* Internationalization (i18n) package. Synchronization of translations
|
6 |
|
|
*
|
7 |
|
|
* Implements hook_i18n_sync_node_fields() for several core modules.
|
8 |
|
|
*/
|
9 |
|
|
|
10 |
|
|
/**
|
11 |
|
|
* Book module. Implements hook_i18n_sync_options().
|
12 |
|
|
*/
|
13 |
|
|
function book_i18n_sync_options($entity_type, $bundle_name) {
|
14 |
|
|
if ($entity_type == 'node') {
|
15 |
|
|
return array(
|
16 |
|
|
'parent' => array(
|
17 |
|
|
'title' => t('Book outline'),
|
18 |
|
|
'description' => t('Set the translated parent for each translation if possible.')
|
19 |
|
|
),
|
20 |
|
|
);
|
21 |
|
|
}
|
22 |
|
|
}
|
23 |
|
|
|
24 |
|
|
/**
|
25 |
|
|
* Comment module. Implements hook_i18n_sync_options().
|
26 |
|
|
*/
|
27 |
|
|
function comment_i18n_sync_options($entity_type, $bundle_name) {
|
28 |
|
|
if ($entity_type == 'node') {
|
29 |
|
|
$fields['comment'] = array('title' => t('Comment settings'));
|
30 |
|
|
return $fields;
|
31 |
|
|
}
|
32 |
|
|
}
|
33 |
|
|
|
34 |
|
|
/**
|
35 |
|
|
* Field module. Implements hook_i18n_sync_options().
|
36 |
|
|
*/
|
37 |
|
|
function field_i18n_sync_options($entity_type, $bundle_name) {
|
38 |
|
|
$sync_fields = array();
|
39 |
|
|
if ($bundle_name) {
|
40 |
|
|
$instances = field_info_instances($entity_type, $bundle_name);
|
41 |
|
|
foreach ($instances as $name => $instance) {
|
42 |
|
|
$sync_fields[$name] = array(
|
43 |
|
|
'title' => $instance['label'],
|
44 |
|
|
'description' => $instance['description'],
|
45 |
|
|
'field_name' => $instance['field_name'],
|
46 |
|
|
'group' => 'fields',
|
47 |
|
|
);
|
48 |
|
|
}
|
49 |
|
|
}
|
50 |
|
|
return $sync_fields;
|
51 |
|
|
}
|
52 |
|
|
|
53 |
|
|
/**
|
54 |
|
|
* Node module. Implements hook_i18n_sync_options().
|
55 |
|
|
*/
|
56 |
|
|
function node_i18n_sync_options($entity_type, $bundle_name) {
|
57 |
|
|
if ($entity_type == 'node') {
|
58 |
|
|
return array(
|
59 |
|
|
'uid' => array('title' => t('Author')),
|
60 |
|
|
'status' => array('title' => t('Status')),
|
61 |
|
|
'created' => array('title' => t('Post date')),
|
62 |
|
|
'promote' => array('title' => t('Promote')),
|
63 |
|
|
'moderate' => array('title' => t('Moderate')),
|
64 |
|
|
'sticky' => array('title' => t('Sticky')),
|
65 |
|
|
'revision' => array('title' => t('Revision'), 'description' => t('Create also new revision for translations')),
|
66 |
|
|
);
|
67 |
|
|
}
|
68 |
|
|
} |