From 7503a1a7b6713c6f96468e5429a2186015b7a085 Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 3 Jul 2013 00:25:32 -0400 Subject: [PATCH] js i18n: finish implementation with addition of the compiled locale strings file to additional javascripts --- inc/functions.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inc/functions.php b/inc/functions.php index b3471469..158973e2 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1244,6 +1244,12 @@ 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