summaryrefslogtreecommitdiffstats
path: root/system/core
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-01-27 13:37:38 +0100
committerAndrey Andreev <narf@bofh.bg>2012-01-27 13:37:38 +0100
commit8d5b24a8c55dc1ae7721e10de094c4aba2ca7eae (patch)
tree255cadaa7381e17e40edac50d817717772360f54 /system/core
parent756e70c1d6b27b20c4e093d48466842fcba31a00 (diff)
Fix issue #128
Diffstat (limited to 'system/core')
-rwxr-xr-xsystem/core/Lang.php23
1 files changed, 12 insertions, 11 deletions
diff --git a/system/core/Lang.php b/system/core/Lang.php
index c40a6856e..d68c04812 100755
--- a/system/core/Lang.php
+++ b/system/core/Lang.php
@@ -25,8 +25,6 @@
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* Language Class
*
@@ -74,22 +72,20 @@ class CI_Lang {
if ($add_suffix == TRUE)
{
- $langfile = str_replace('_lang.', '', $langfile).'_lang';
+ $langfile = str_replace('_lang', '', $langfile).'_lang';
}
$langfile .= '.php';
- if (in_array($langfile, $this->is_loaded, TRUE))
+ if ($idiom == '')
{
- return;
+ $config =& get_config();
+ $idiom = ( ! empty($config['language'])) ? $config['language'] : 'english';
}
- $config =& get_config();
-
- if ($idiom == '')
+ if ($return == FALSE && isset($this->is_loaded[$langfile]) && $this->is_loaded[$langfile] === $idiom)
{
- $deft_lang = ( ! isset($config['language'])) ? 'english' : $config['language'];
- $idiom = ($deft_lang == '') ? 'english' : $deft_lang;
+ return;
}
// Determine where the language file is and load it
@@ -121,6 +117,11 @@ class CI_Lang {
if ( ! isset($lang) OR ! is_array($lang))
{
log_message('error', 'Language file contains no data: language/'.$idiom.'/'.$langfile);
+
+ if ($return == TRUE)
+ {
+ return array();
+ }
return;
}
@@ -129,7 +130,7 @@ class CI_Lang {
return $lang;
}
- $this->is_loaded[] = $langfile;
+ $this->is_loaded[$langfile] = $idiom;
$this->language = array_merge($this->language, $lang);
unset($lang);