diff options
Diffstat (limited to 'inc/init.php')
-rw-r--r-- | inc/init.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/inc/init.php b/inc/init.php index d825b5250..24920a17d 100644 --- a/inc/init.php +++ b/inc/init.php @@ -259,17 +259,33 @@ function init_paths(){ $conf['media_changelog'] = $conf['metadir'].'/_media.changes'; } +/** + * Load the language strings + * + * @param string $langCode language code, as passed by event handler + */ function init_lang($langCode) { //prepare language array - global $lang; + global $lang, $config_cascade; $lang = array(); //load the language files require(DOKU_INC.'inc/lang/en/lang.php'); + foreach ($config_cascade['lang']['core'] as $config_file) { + if (@file_exists($config_file . 'en/lang.php')) { + include($config_file . 'en/lang.php'); + } + } + if ($langCode && $langCode != 'en') { if (file_exists(DOKU_INC."inc/lang/$langCode/lang.php")) { require(DOKU_INC."inc/lang/$langCode/lang.php"); } + foreach ($config_cascade['lang']['core'] as $config_file) { + if (@file_exists($config_file . "$langCode/lang.php")) { + include($config_file . "$langCode/lang.php"); + } + } } } |