diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-11-22 16:26:29 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-11-22 16:26:29 +0100 |
commit | ce0c9561e9068d5dab9c473f1ca0709b0d222cf1 (patch) | |
tree | e4cb5f26a6ee9eb3e52c3314c33c98e2e526b9d8 /system | |
parent | 53fff911de3564c8688550452f138991730a704f (diff) |
Fix issue #118 (manually implementing PR #1832)
Diffstat (limited to 'system')
-rw-r--r-- | system/core/Lang.php | 7 | ||||
-rw-r--r-- | system/libraries/Unit_test.php | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/system/core/Lang.php b/system/core/Lang.php index 896385134..5d824cee6 100644 --- a/system/core/Lang.php +++ b/system/core/Lang.php @@ -151,15 +151,16 @@ class CI_Lang { * * Fetches a single line of text from the language array * - * @param string $line Language line key + * @param string $line Language line key + * @param bool $log_errors Whether to log an error message if the line is not found * @return string Translation */ - public function line($line = '') + public function line($line = '', $log_errors = TRUE) { $value = ($line === '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line]; // Because killer robots like unicorns! - if ($value === FALSE) + if ($value === FALSE && $log_errors === TRUE) { log_message('error', 'Could not find the language line "'.$line.'"'); } diff --git a/system/libraries/Unit_test.php b/system/libraries/Unit_test.php index 842b4aebd..05c7eef78 100644 --- a/system/libraries/Unit_test.php +++ b/system/libraries/Unit_test.php @@ -284,11 +284,11 @@ class CI_Unit_test { continue; } - if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$val)))) + if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$val), FALSE))) { $val = $line; } - $temp[$CI->lang->line('ut_'.$key)] = $val; + $temp[$CI->lang->line('ut_'.$key, FALSE)] = $val; } $retval[] = $temp; |