summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-07-31 06:54:53 -0400
committerMichael Foster <savetheinternet@tinyboard.org>2013-07-31 06:54:53 -0400
commit42e16e233a53e73d8d8796814a588d5df1091f7b (patch)
treefb8e865831c886aa592c1393a0504e7844b951e2
parent439795e63b1468000992275320b6c7e3f43fa9c0 (diff)
Javascript l10n: Work without $config['additional_javascript_compile']
-rw-r--r--inc/functions.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/inc/functions.php b/inc/functions.php
index d904e1a2..1ffa32df 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -1277,16 +1277,17 @@ function buildJavascript() {
'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(
'config' => $config,
'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']) {
foreach ($config['additional_javascript'] as $file) {
$script .= file_get_contents($file);