Commit c76d0fb6 by Taylor Otwell

use language in paginator class.

parent 7e439ab5
...@@ -9,21 +9,21 @@ class Lang { ...@@ -9,21 +9,21 @@ class Lang {
* *
* @var array * @var array
*/ */
private static $lines = array(); public static $lines = array();
/** /**
* The key of the line that is being requested. * The key of the line that is being requested.
* *
* @var string * @var string
*/ */
private $key; public $key;
/** /**
* The place-holder replacements. * The place-holder replacements.
* *
* @var array * @var array
*/ */
private $replacements = array(); public $replacements = array();
/** /**
* Create a new Lang instance. * Create a new Lang instance.
...@@ -117,7 +117,9 @@ class Lang { ...@@ -117,7 +117,9 @@ class Lang {
*/ */
private function load($file, $language) private function load($file, $language)
{ {
if ( ! array_key_exists($language.$file, static::$lines) and file_exists($path = APP_PATH.'lang/'.$language.'/'.$file.EXT)) if (array_key_exists($language.$file, static::$lines)) return;
if (file_exists($path = APP_PATH.'lang/'.$language.'/'.$file.EXT))
{ {
static::$lines[$language.$file] = require $path; static::$lines[$language.$file] = require $path;
} }
......
...@@ -150,7 +150,7 @@ class Paginator { ...@@ -150,7 +150,7 @@ class Paginator {
*/ */
public function previous() public function previous()
{ {
$text = Lang::line('pagination.previous')->get(); $text = Lang::line('pagination.previous')->get($this->language);
return ($this->page > 1) ? $this->link($this->page - 1, $text, 'prev_page').' ' : HTML::span($text, array('class' => 'disabled prev_page')).' '; return ($this->page > 1) ? $this->link($this->page - 1, $text, 'prev_page').' ' : HTML::span($text, array('class' => 'disabled prev_page')).' ';
} }
...@@ -162,7 +162,7 @@ class Paginator { ...@@ -162,7 +162,7 @@ class Paginator {
*/ */
public function next() public function next()
{ {
$text = Lang::line('pagination.next')->get(); $text = Lang::line('pagination.next')->get($this->language);
return ($this->page < $this->last_page) ? $this->link($this->page + 1, $text, 'next_page') : HTML::span($text, array('class' => 'disabled next_page')); return ($this->page < $this->last_page) ? $this->link($this->page + 1, $text, 'next_page') : HTML::span($text, array('class' => 'disabled next_page'));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment