From 9cfcb4bb32e2fb8f5dbabd7faa06e47adf1c23af Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sun, 4 Dec 2011 19:07:42 +0000 Subject: improved i18n --- .../Application/Controllers/GenericController.php | 27 +++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'h-source/Application/Controllers/GenericController.php') diff --git a/h-source/Application/Controllers/GenericController.php b/h-source/Application/Controllers/GenericController.php index 639faa5..3a8c1f0 100644 --- a/h-source/Application/Controllers/GenericController.php +++ b/h-source/Application/Controllers/GenericController.php @@ -34,23 +34,29 @@ class GenericController extends BaseController $popup = new Popup(); $popup->name = gtext('sort by'); + + $popNames = array(gtext('last inserted'),gtext('alphabetically'),gtext('alphabetically desc'),gtext('compatibility')); + $popValues = array('last-inserted','alphabetically','alphabetically-desc','compatibility'); + switch ($this->controller) { case 'printers': - $popup->itemsName = array('last inserted','alphabetically','alphabetically desc','compatibility'); - $popup->itemsValue = array('last-inserted','alphabetically','alphabetically-desc','compatibility'); + $popup->itemsName = $popNames; + $popup->itemsValue = $popValues; break; case 'notebooks': - $popup->itemsName = array('last inserted','alphabetically','alphabetically desc','compatibility'); - $popup->itemsValue = array('last-inserted','alphabetically','alphabetically-desc','compatibility'); + $popup->itemsName = $popNames; + $popup->itemsValue = $popValues; break; case 'scanners': - $popup->itemsName = array('last inserted','alphabetically','alphabetically desc','compatibility'); - $popup->itemsValue = array('last-inserted','alphabetically','alphabetically-desc','compatibility'); + $popup->itemsName = $popNames; + $popup->itemsValue = $popValues; break; default: - $popup->itemsName = array('last inserted','alphabetically','alphabetically desc'); - $popup->itemsValue = array('last-inserted','alphabetically','alphabetically-desc'); + array_pop($popNames); + array_pop($popValues); + $popup->itemsName = $popNames; + $popup->itemsValue = $popValues; break; } @@ -445,6 +451,9 @@ class GenericController extends BaseController $popup['sort-by'] = $this->orderPopup; $this->helper('Popup',$this->controller.'/catalogue/'.$this->lang,$popup,'inclusive','page'); + + $this->h['Popup']->allString = gtext("All"); + //create the HTML of the popup $data['popup'] = $this->h['Popup']->render(); @@ -474,6 +483,8 @@ class GenericController extends BaseController $data['pageList'] = $this->h['Pages']->render($page-3,7); $data['topNotice'] = $this->getModule(array('devices',$this->controller,'catalogue')); + + $data['popupLabel'] = $this->mod->getPopupLabel($this->viewArgs); $this->append($data); -- cgit v1.2.3