From de3dbc36dab42d86c66d76efd6fdb1d1dce71ce8 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Mon, 27 Dec 2010 17:41:02 +0000 Subject: Languages can now be placed in packages folders, and added ->load->get_package_paths(). --- system/core/Lang.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'system/core/Lang.php') 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); } -- cgit v1.2.3-24-g4f1b