From 1b6821e4302c6864ab26d3bf69d14bf22efb6c3a Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 4 Oct 2008 17:44:54 +0000 Subject: [PATCH] BUGFIX Automatically including sapphire/javascript/i18n.js in Requirements::process_i18n_javascript() to avoid errors when Requirements are manually overwritten git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63640 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/Requirements.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/Requirements.php b/core/Requirements.php index db75806fc..4cc72031b 100644 --- a/core/Requirements.php +++ b/core/Requirements.php @@ -355,11 +355,14 @@ class Requirements { * Assumes that a subfolder /javascript exists relative to the included * javascript file, with a file named after the locale - * so usually /javascript/lang/en_US.js. - * - * Caution: Assumes the manual inclusion of sapphire/javascript/i18n.js - * before */ protected static function process_i18n_javascript() { + // ensure to include the i18n base library + if(!isset(self::$javascript[SAPPHIRE_DIR . '/javascript/i18n.js'])) { + self::$javascript[SAPPHIRE_DIR . '/javascript/i18n.js'] = true; + } + + // include the specific locale and the master locale for each module foreach(array_diff_key(self::$javascript,self::$blocked) as $file => $dummy) { if(preg_match('/^http[s]?/', $file)) continue;