--- locale.module.orig	2008-09-04 08:57:36.000000000 +0200
+++ locale.module	2008-09-04 11:41:23.000000000 +0200
@@ -312,6 +312,17 @@ function locale_theme() {
   );
 }
 
+/**
+ * Implementation of hook_file_download().
+ *
+ * Ensure that translation JS are always downloadable.
+ */
+function locale_file_download($file) {
+  if (strpos($file, variable_get('locale_js_directory', 'languages')) === 0) {
+    return array('Content-type: application/x-javascript');
+  }
+}
+
 // ---------------------------------------------------------------------------------
 // Locale core functionality
 
@@ -551,7 +562,11 @@ function locale_update_js_files() {
 
   // Add the translation JavaScript file to the page.
   if ($files && !empty($language->javascript)) {
-    drupal_add_js($dir .'/'. $language->language .'_'. $language->javascript .'.js', 'core');
+    $path = file_create_url($dir .'/'. $language->language .'_'.
+			    $language->javascript .'.js');
+    // Strip leading slashes
+    $path = ltrim($path, '/');
+    drupal_add_js($path, 'core');
   }
 }
 

