From 2bbb3b07e948f2d900114bea4a92cfd3fb8d0611 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 14 Mar 2012 12:10:31 +0000 Subject: [PATCH] using new egw.langRequire to load translations only once (per top-window load) --- etemplate/inc/class.etemplate_new.inc.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/etemplate/inc/class.etemplate_new.inc.php b/etemplate/inc/class.etemplate_new.inc.php index 5e85c13287..62cee4c034 100644 --- a/etemplate/inc/class.etemplate_new.inc.php +++ b/etemplate/inc/class.etemplate_new.inc.php @@ -105,16 +105,6 @@ class etemplate_new extends etemplate_widget_template // Include the etemplate2 javascript code egw_framework::validate_file('.', 'etemplate2', 'etemplate'); - // load translations - translation::add_app('etemplate'); - foreach(translation::$loaded_apps as $app => $lang) - { - egw_framework::validate_file('/phpgwapi/lang.php', array( - 'app' => $app, - 'lang' => $lang, - )); - } - if (!$this->rel_path) throw new egw_exception_assertion_failed('No (valid) template read!'); // generate new etemplate request object @@ -163,9 +153,18 @@ class etemplate_new extends etemplate_widget_template { parse_navbar(); } + // load translations + translation::add_app('etemplate'); + $langRequire = array(); + foreach(translation::$loaded_apps as $app => $lang) + { + $langRequire[] = array('app' => $app, 'lang' => $lang); + } + echo '