Add language translation support to CI_Pagination (#1589)
diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php
index da4b892..2f1bcfb 100644
--- a/system/libraries/Pagination.php
+++ b/system/libraries/Pagination.php
@@ -304,6 +304,16 @@
 	 */
 	public function __construct($params = array())
 	{
+		$CI =& get_instance();
+		$CI->load->language('paginaton');
+		foreach (array('first_link', 'next_link', 'prev_link', 'last_link') as $key)
+		{
+			if (($val = $CI->lang->line('pagination_'.$key)) !== FALSE)
+			{
+				$this->$key = $val;
+			}
+		}
+
 		$this->initialize($params);
 		log_message('debug', 'Pagination Class Initialized');
 	}
@@ -316,7 +326,7 @@
 	 * @param	array	$params	Initialization parameters
 	 * @return	CI_Pagination
 	 */
-	public function initialize($params = array())
+	public function initialize(array $params = array())
 	{
 		if (isset($params['attributes']) && is_array($params['attributes']))
 		{
@@ -332,14 +342,11 @@
 			unset($params['anchor_class']);
 		}
 
-		if (count($params) > 0)
+		foreach ($params as $key => $val)
 		{
-			foreach ($params as $key => $val)
+			if (property_exists($this, $this->$key))
 			{
-				if (isset($this->$key))
-				{
-					$this->$key = $val;
-				}
+				$this->$key = $val;
 			}
 		}