diff options
author | Andreas Gohr <andi@splitbrain.org> | 2014-09-29 18:34:02 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2014-09-29 18:34:02 +0200 |
commit | 85674a734d93fb3880a79c9d6a8659a57ec8190e (patch) | |
tree | 2737b2295ae45606f211edf07927ace5713813ae /inc/init.php | |
parent | 17553fca1944b80c25826f2f71620bbf64e1a49b (diff) | |
parent | 0440ca46b69be8a0fd706825f9d319299db892db (diff) | |
download | rpg-85674a734d93fb3880a79c9d6a8659a57ec8190e.tar.gz rpg-85674a734d93fb3880a79c9d6a8659a57ec8190e.tar.bz2 |
Merge pull request #708 from splitbrain/overridablelangstrings
extend lang file cascade, so users can override some lang strings
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"); + } + } } } |