diff options
author | Phil Sturgeon <email@philsturgeon.co.uk> | 2010-12-27 18:41:02 +0100 |
---|---|---|
committer | Phil Sturgeon <email@philsturgeon.co.uk> | 2010-12-27 18:41:02 +0100 |
commit | de3dbc36dab42d86c66d76efd6fdb1d1dce71ce8 (patch) | |
tree | 622cc7ac80820ffc059c03a2f3572d12e3ab60ac /system/core/Lang.php | |
parent | 6c597f8d4b1b1bc12ccb4ad298053f03e6def36c (diff) |
Languages can now be placed in packages folders, and added ->load->get_package_paths().
Diffstat (limited to 'system/core/Lang.php')
-rw-r--r-- | system/core/Lang.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/system/core/Lang.php b/system/core/Lang.php index e7867b354..8ec179771 100644 --- a/system/core/Lang.php +++ b/system/core/Lang.php @@ -78,17 +78,21 @@ class CI_Lang { { include($alt_path.'language/'.$idiom.'/'.$langfile); } - elseif (file_exists(APPPATH.'language/'.$idiom.'/'.$langfile)) - { - include(APPPATH.'language/'.$idiom.'/'.$langfile); - } else { - if (file_exists(BASEPATH.'language/'.$idiom.'/'.$langfile)) + $found = FALSE; + + foreach (get_instance()->load->get_package_paths(TRUE) as $package_path) { - include(BASEPATH.'language/'.$idiom.'/'.$langfile); + if (file_exists($package_path.'language/'.$idiom.'/'.$langfile)) + { + include($package_path.'language/'.$idiom.'/'.$langfile); + $found = TRUE; + break; + } } - else + + if ($found !== TRUE) { show_error('Unable to load the requested language file: language/'.$idiom.'/'.$langfile); } |