From bc0e706c020072d512482a632d1e625d72f8e5ea Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 2 Aug 2011 11:03:48 -0500 Subject: [PATCH] Refactoring the Lang class. --- system/lang.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/system/lang.php b/system/lang.php index 7a0b177e..c20e3ec1 100644 --- a/system/lang.php +++ b/system/lang.php @@ -61,7 +61,7 @@ public static function line($key, $replacements = array()) * @param mixed $default * @return string */ - public function get($language = null, $default = null) + public function get($language = null, $default = '') { if (is_null($language)) { @@ -72,12 +72,7 @@ public function get($language = null, $default = null) $this->load($file, $language); - if ( ! isset(static::$lines[$language.$file][$line])) - { - return is_callable($default) ? call_user_func($default) : $default; - } - - $line = static::$lines[$language.$file][$line]; + $line = Arr::get(static::$lines[$language.$file], $line, $default); foreach ($this->replacements as $key => $value) {