'Metadata for source strings.', 'fields' => array( 'lid' => array( 'type' => 'int', 'not null' => TRUE, 'default' => 0, 'description' => 'Source string ID. References {locales_source}.lid.', ), 'textgroup' => array( 'type' => 'varchar', 'length' => 50, 'not null' => TRUE, 'default' => 'default', 'description' => 'A module defined group of translations, see hook_locale().', ), 'context' => array( 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '', 'description' => 'Full string ID for quick search: type:objectid:property.', ), 'objectid' => array( 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '', 'description' => 'Object ID.', ), 'type' => array( 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '', 'description' => 'Object type for this string.', ), 'property' => array( 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '', 'description' => 'Object property for this string.', ), 'objectindex' => array( 'type' => 'int', 'not null' => TRUE, 'default' => 0, 'description' => 'Integer value of Object ID.', ), 'format' => array( 'type' => 'varchar', 'length' => 255, 'not null' => FALSE, 'description' => 'The {filter_format}.format of the string.', ), ), 'primary key' => array('lid'), 'indexes' => array( 'group_context' => array('textgroup', 'context'), ), ); return $schema; } /** * Implements hook_schema_alter(). */ function i18n_string_schema_alter(&$schema) { // Add field for tracking whether translations need updating. $schema['locales_target']['fields']['i18n_status'] = array( 'description' => 'A boolean indicating whether this translation needs to be updated.', 'type' => 'int', 'not null' => TRUE, 'default' => 0, ); } /** * Populate fields from old locale table (textgroup, location) and drop indexes from locales_source */ function i18n_string_update_7000() { // @todo Update from d6 variable_del('i18nstrings_allowed_textgroups'); // If we've got old table from D6, move data to new one } /** * Rename i18n_strings table to i18n_string to avoid clashes when upgrading */ function i18n_string_update_7001() { db_rename_table('i18n_strings', 'i18n_string'); drupal_get_schema(NULL, TRUE); } /** * Notes for update script */ // Added fields: context, textgroup // // Drop all indexes from locales_source // Update format field // Update string names: profile, cck => field // Update string names: /** * Old strings to update. All these will be handled by i18n_field module * * 'cck:field:'. $content_type .'-'. $field_name .':widget_label' * --> 'field:$field_name:$bundle:label' (though not used atm) * 'cck:field:'. $content_type .'-'. $field_name .':widget_description' * --> 'field:$field_name:$bundle:description' * 'cck:fieldgroup:'. $content_type .'-'. $group_name .':display_description' * 'cck:fieldgroup:'. $content_type .'-'. $group_name .':form_description', $group['settings']['form']['description']); * * Profile: * profile:field:$field_name:title|explanation|options * "profile:category", $field->category * * Node type * nodetype:type:[type]:[property] -> node:type:[type]:[property] * Property names: title -> title_label */