Index: i18nviews/i18nviews.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/i18n/i18nviews/i18nviews.module,v
retrieving revision 1.4.2.10
diff -u -p -r1.4.2.10 i18nviews.module
--- i18nviews/i18nviews.module	17 Nov 2008 19:59:37 -0000	1.4.2.10
+++ i18nviews/i18nviews.module	12 Dec 2008 20:28:47 -0000
@@ -55,7 +55,7 @@ function i18nviews_locale_refresh() {
 function i18nviews_views_pre_view(&$view, &$display_id, &$args) {
   // Translate all possible display strings, step by step.
   // I.e. for a page, there seems to be a 'page' and a 'default' display.
-  $fields = array('title', 'header', 'footer', 'empty');
+  $fields = _i18nviews_display_fields();
   if (!empty($view->display) && is_array($view->display)) {
     foreach (array($display_id, 'default') as $display) {
       if(!empty($view->display[$display])) {
@@ -87,6 +87,16 @@ function i18nviews_views_pre_view(&$view
 }
 
 /**
+ * Return the Views fields that should be translated.
+ *
+ * @return
+ *   Array of field names.
+ */
+function _i18nviews_display_fields() {
+  return array('title', 'header', 'footer', 'empty');
+}
+
+/**
  * Translate a group of fields.
  *
  * We get the translated fields out of the array so they are not translated again.
@@ -150,6 +160,31 @@ function i18ntaxonomy_views_handler_fiel
   return $links;
 }
 
+/**
+ * Implementation of hook_form_id_alter().
+ *
+ * Add a submit handler to the submit button on views_ui_edit_display_form. 
+ */
+function i18nviews_form_views_ui_edit_display_form_alter(&$form, $form_state) {
+  $form['buttons']['submit']['#submit'][] = 'i18nviews_views_ui_edit_display_submit';
+}
+
+/**
+ * Submit handler for views_ui_edit_display_form.
+ *
+ * Creates or updates translation source records for specified Views fields.
+ */
+function i18nviews_views_ui_edit_display_submit($form, &$form_state) {
+  $fields = _i18nviews_display_fields();
+  foreach ($fields as $field) {
+    if (isset($form_state['values'][$field])) {
+      $name = $form_state['view']->name;
+      $group = $form_state['display_id'];
+      tt("views:$name:$group:$field", $form_state['values'][$field], NULL, TRUE);
+    }
+  }
+}
+
 function i18nviews_views_api() {
   return array(
     'api' => '2.0',
