Refactoring the Lang class.
This commit is contained in:
parent
92b57ca2d7
commit
bc0e706c02
|
@ -61,7 +61,7 @@ public static function line($key, $replacements = array())
|
||||||
* @param mixed $default
|
* @param mixed $default
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function get($language = null, $default = null)
|
public function get($language = null, $default = '')
|
||||||
{
|
{
|
||||||
if (is_null($language))
|
if (is_null($language))
|
||||||
{
|
{
|
||||||
|
@ -72,12 +72,7 @@ public function get($language = null, $default = null)
|
||||||
|
|
||||||
$this->load($file, $language);
|
$this->load($file, $language);
|
||||||
|
|
||||||
if ( ! isset(static::$lines[$language.$file][$line]))
|
$line = Arr::get(static::$lines[$language.$file], $line, $default);
|
||||||
{
|
|
||||||
return is_callable($default) ? call_user_func($default) : $default;
|
|
||||||
}
|
|
||||||
|
|
||||||
$line = static::$lines[$language.$file][$line];
|
|
||||||
|
|
||||||
foreach ($this->replacements as $key => $value)
|
foreach ($this->replacements as $key => $value)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue