--- modules/locale/locale.module.orig 2009-07-15 11:59:35.000000000 +0200 +++ modules/locale/locale.module 2009-07-15 12:13:46.000000000 +0200 @@ -301,6 +301,8 @@ ); } + + // --------------------------------------------------------------------------------- // Locale core functionality @@ -476,6 +478,20 @@ } } + /** + * 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'); + } +} + + /** * Update JavaScript translation file, if required, and add it to the page. * @@ -487,7 +503,9 @@ 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 @@ -585,3 +603,5 @@ return $block; } } + +