### Eclipse Workspace Patch 1.0 #P webform-DRUPAL-6--3 Index: includes/webform.components.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/webform/includes/webform.components.inc,v retrieving revision 1.25.2.15 diff -u -r1.25.2.15 webform.components.inc --- includes/webform.components.inc 30 Jun 2010 20:45:25 -0000 1.25.2.15 +++ includes/webform.components.inc 1 Jul 2010 09:23:10 -0000 @@ -685,6 +685,14 @@ db_query('DELETE FROM {webform_component} WHERE nid = %d AND cid = %d', $node->nid, $component['cid']); db_query('DELETE FROM {webform_submitted_data} WHERE nid = %d AND cid = %d', $node->nid, $component['cid']); + if (module_exists('i18nstrings')) { + $nid = db_result(db_query("SELECT nid FROM {webform_component} WHERE name='%s'", $component['name'])); + if ($nid > 0) { //delete string if it's not being used somewhere else + $i18_identifier = "webform:webform:" . $component['name']; + i18nstrings_remove($i18_identifier); + } + } + // Delete all elements under this element. $result = db_query('SELECT cid FROM {webform_component} WHERE nid = %d AND pid = %d', $node->nid, $component['cid']); while ($row = db_fetch_object($result)) { Index: webform.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/webform/webform.module,v retrieving revision 1.196.2.40 diff -u -r1.196.2.40 webform.module --- webform.module 30 Jun 2010 20:31:31 -0000 1.196.2.40 +++ webform.module 1 Jul 2010 09:23:09 -0000 @@ -1063,7 +1063,11 @@ $component['nid'] = $node->nid; $component['cid'] = $c['cid']; $component['form_key'] = $c['form_key'] ? $c['form_key'] : $c['cid']; - $component['name'] = t($c['name']); + if (module_exists('i18nstrings')) { + $i18_identifier = "webform:webform:" . $c['name']; + i18nstrings_update($i18_identifier, $c['name']); + $component['name'] = i18nstrings($i18_identifier, $c['name']); + } $component['type'] = $c['type']; $component['value'] = $c['value']; $component['extra'] = unserialize($c['extra']); @@ -2971,3 +2975,13 @@ return $form_info; } + +/** + * implementation of hook_locale + */ +function webform_locale($op = 'groups', $group = NULL) { + switch ($op) { + case 'groups': + return array('webform' => t('Webform labels')); + } +}