Skip to content

Commit

Permalink
added INIT_LANG_LOAD event
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Eckelmann committed Jan 24, 2012
1 parent c51f90d commit 6d06b26
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions inc/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,6 @@ function delta_time($start=0) {
}
}

//prepare language array
global $lang;
$lang = array();

//load the language files
require_once(DOKU_INC.'inc/lang/en/lang.php');
if ( $conf['lang'] && $conf['lang'] != 'en' ) {
require_once(DOKU_INC.'inc/lang/'.$conf['lang'].'/lang.php');
}

//prepare license array()
global $license;
$license = array();
Expand Down Expand Up @@ -214,6 +204,10 @@ function_exists('ob_gzhandler')) {
global $EVENT_HANDLER;
$EVENT_HANDLER = new Doku_Event_Handler();

$local = $conf['lang'];
trigger_event('INIT_LANG_LOAD', $local, 'init_lang', true);


// setup authentication system
if (!defined('NOSESSION')) {
auth_setup();
Expand Down Expand Up @@ -256,6 +250,20 @@ function init_paths(){
$conf['media_changelog'] = $conf['metadir'].'/_media.changes';
}

function init_lang($langCode) {
//prepare language array
global $lang;
$lang = array();

//load the language files
require_once(DOKU_INC.'inc/lang/en/lang.php');
if ($langCode && $langCode != 'en') {
if (file_exists(DOKU_INC."inc/lang/$langCode/lang.php")) {
require_once(DOKU_INC."inc/lang/$langCode/lang.php");
}
}
}

/**
* Checks the existance of certain files and creates them if missing.
*/
Expand Down

0 comments on commit 6d06b26

Please sign in to comment.