--- locale.module.orig	2008-09-04 08:57:36.000000000 +0200
+++ locale.module	2008-09-15 10:58:17.000000000 +0200
@@ -312,6 +312,20 @@ 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'));
+  $path = substr($path, strlen($GLOBALS['base_url']) + 1);
+
+  if (strpos($file, $path) === 0) {
+    return array('Content-type: application/x-javascript');
+  }
+}
+
 // ---------------------------------------------------------------------------------
 // Locale core functionality
 
@@ -498,7 +512,9 @@ function locale_system_update($component
 function locale_update_js_files() {
   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());
 
   // The first three parameters are NULL in order to get an array with all
@@ -551,7 +567,7 @@ 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');
+    drupal_add_js($dir . '/'. $language->language .'_'. $language->javascript .'.js', 'core');
   }
 }
 
