Index: l10n_community/export.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/l10n_server/l10n_community/Attic/export.inc,v
retrieving revision 1.1.2.15.2.24.2.12
diff -u -p -r1.1.2.15.2.24.2.12 export.inc
--- l10n_community/export.inc	29 Jul 2010 14:54:37 -0000	1.1.2.15.2.24.2.12
+++ l10n_community/export.inc	29 Jul 2010 15:10:19 -0000
@@ -249,8 +249,14 @@ function _l10n_community_export_string_f
     // format, where the numbers represent the line numbers of source
     // occurances in the respective source files.
     $comment = array();
+    $injs = FALSE;
     foreach ($export_string['comment'] as $path => $lines) {
       $comment[] = preg_replace('!(^[^/]+/)!', '', $path) .':'. join(',', $lines);
+      if (preg_match('!.js$!', $path)) {
+        // This string appears in JS files. Important to export in the compact
+        // method, so Drupal can still associate it with JS files.
+        $injs = TRUE;
+      }
     }
     $comment = '#: '. join('; ', $comment) ."\n";
     if ($export_string['has_suggestion']) {
@@ -305,12 +311,17 @@ function _l10n_community_export_string_f
     // Append extension.
     $filename .= ($template ? '.pot' : ($version != 'flat-package' ? ('.'. $language->language) : '') .'.po');
 
+    // Lead with a comment for this file.
+    if (!$compact) {
+      $output = $comment;
+    }
+    elseif ($injs) {
+      $output = "#: in.js\n";
+    }
+
     if (strpos($export_string['value'], "\0") !== FALSE) {
       // This is a string with plural variants.
       list($singular, $plural) = explode("\0", $export_string['value']);
-      if (!$compact) {
-        $output = $comment;
-      }
       if (!empty($export_string['context'])) {
         $output .= 'msgctxt '. _l10n_community_export_string($export_string['context']);
       }
@@ -337,9 +348,6 @@ function _l10n_community_export_string_f
     }
     else {
       // Simple string (and possibly translation pair).
-      if (!$compact) {
-        $output = $comment;
-      }
       if (!empty($export_string['context'])) {
         $output .= 'msgctxt '. _l10n_community_export_string($export_string['context']);
       }
