Javascript l10n: Work without $config['additional_javascript_compile']

This commit is contained in:
Michael Foster 2013-07-31 06:54:53 -04:00
parent 439795e63b
commit 42e16e233a

View File

@ -1277,16 +1277,17 @@ function buildJavascript() {
'uri' => addslashes((!empty($uri) ? $config['uri_stylesheets'] : '') . $uri)); 'uri' => addslashes((!empty($uri) ? $config['uri_stylesheets'] : '') . $uri));
} }
// Check if we have translation for the javascripts; if yes, we add it to additional javascripts
list($pure_locale) = explode(".", $config['locale']);
if (file_exists ($jsloc = "inc/locale/".$pure_locale."/LC_MESSAGES/javascript.js")) {
array_unshift($config['additional_javascript'], $jsloc);
}
$script = Element('main.js', array( $script = Element('main.js', array(
'config' => $config, 'config' => $config,
'stylesheets' => $stylesheets 'stylesheets' => $stylesheets
)); ));
// Check if we have translation for the javascripts; if yes, we add it to additional javascripts
list($pure_locale) = explode(".", $config['locale']);
if (file_exists ($jsloc = "inc/locale/$pure_locale/LC_MESSAGES/javascript.js")) {
$script = file_get_contents($jsloc) . "\n\n" . $script;
}
if ($config['additional_javascript_compile']) { if ($config['additional_javascript_compile']) {
foreach ($config['additional_javascript'] as $file) { foreach ($config['additional_javascript'] as $file) {
$script .= file_get_contents($file); $script .= file_get_contents($file);