### Eclipse Workspace Patch 1.0
#P Drupal HEAD #2
Index: includes/locale.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/locale.inc,v
retrieving revision 1.94
diff -u -r1.94 locale.inc
--- includes/locale.inc	2 Oct 2006 11:49:50 -0000	1.94
+++ includes/locale.inc	4 Oct 2006 22:02:59 -0000
@@ -283,6 +283,11 @@
     '#options' => $languages,
     '#description' => t('Select the language you would like to export in gettext Portable Object (.po) format.'),
   );
+  $form['export']['translated_strings_only'] = array('#type' => 'checkbox',
+    '#title' => t('Export translated strings only'),
+    '#default_value' => FALSE,
+    '#description' => t('Select this option to only export strings that have been translated.'),
+  );
   $form['export']['submit'] = array('#type' => 'submit', '#value' => t('Export'));
   return $form;
 }
@@ -322,7 +327,7 @@
  * Process a locale export form submissions.
  */
 function _locale_export_po_form_submit($form_id, $form_values) {
-  _locale_export_po($form_values['langcode']);
+  _locale_export_po($form_values['langcode'], $form_values['translated_strings_only']);
 }
 
 /**
@@ -1101,7 +1106,7 @@
  *
  * @param $language Selects a language to generate the output for
  */
-function _locale_export_po($language) {
+function _locale_export_po($language, $translated_strings_only = FALSE) {
   global $user;
 
   // Get language specific strings, or all strings
@@ -1178,7 +1183,7 @@
   print $header;
 
   foreach ($parent as $lid => $message) {
-    if (!isset($message['child'])) {
+    if (!isset($message['child']) && (!$translated_strings_only xor $message['translation'] !== '')) {
       if ($message['comment']) {
         print '#: '. $message['comment'] ."\n";
       }
