From c76d0fb66906eea2d55993433933378c87604ce0 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 26 Jul 2011 23:23:34 -0500 Subject: [PATCH] use language in paginator class. --- system/lang.php | 10 ++++++---- system/paginator.php | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/system/lang.php b/system/lang.php index 711d489d..c02f11a6 100644 --- a/system/lang.php +++ b/system/lang.php @@ -9,21 +9,21 @@ class Lang { * * @var array */ - private static $lines = array(); + public static $lines = array(); /** * The key of the line that is being requested. * * @var string */ - private $key; + public $key; /** * The place-holder replacements. * * @var array */ - private $replacements = array(); + public $replacements = array(); /** * Create a new Lang instance. @@ -117,7 +117,9 @@ private function parse($key) */ 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; } diff --git a/system/paginator.php b/system/paginator.php index 14113b6d..e9d5861b 100644 --- a/system/paginator.php +++ b/system/paginator.php @@ -150,7 +150,7 @@ private function slider($adjacent) */ 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')).' '; } @@ -162,7 +162,7 @@ public function previous() */ 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')); }