Index: modules/locale/locale.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v
retrieving revision 1.237
diff -u -p -r1.237 locale.module
--- modules/locale/locale.module	5 Feb 2009 00:32:46 -0000	1.237
+++ modules/locale/locale.module	31 Mar 2009 10:42:03 -0000
@@ -320,6 +320,19 @@ function locale_theme() {
   );
 }
 
+/**
+ * Implementation of hook_file_download().
+ *
+ * Ensure that translation JS are always downloadable.
+ */
+function locale_file_download($file) {
+  $path = file_create_url(variable_get('locale_js_directory', 'languages'));
+
+  if (strpos(file_create_url($file), $path) === 0) {
+    return array('Content-type: application/x-javascript');
+  }
+}
+
 // ---------------------------------------------------------------------------------
 // Locale core functionality
 
@@ -506,7 +519,9 @@ function locale_system_update($component
 function locale_js_alter(&$javascript) {
   global $language;
 
-  $dir = file_create_path(variable_get('locale_js_directory', 'languages'));
+  $dir = file_create_url(file_create_path(variable_get('locale_js_directory',
+                                                      'languages')));
+  $dir = substr($dir, strlen($GLOBALS['base_url']) + 1);
   $parsed = variable_get('javascript_parsed', array());
   $files = $new_files = FALSE;
 
