aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-12-04 19:07:42 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-12-04 19:07:42 +0000
commit9cfcb4bb32e2fb8f5dbabd7faa06e47adf1c23af (patch)
treec1ee0451fe37e64dfe29c98cf8c0905e9ab53767
parentd30d70afd95653bb356603612db6519d6e6ebead (diff)
improved i18n
-rw-r--r--h-source/Application/Controllers/AcquisitioncardsController.php3
-rw-r--r--h-source/Application/Controllers/GenericController.php27
-rw-r--r--h-source/Application/Include/languages.php7
-rw-r--r--h-source/Application/Include/myFunctions.php16
-rw-r--r--h-source/Application/Models/GenericModel.php26
-rw-r--r--h-source/Application/Views/Acquisitioncards/catalogue.php14
-rw-r--r--h-source/Application/Views/page.php8
-rw-r--r--h-source/Public/Css/main.css2
8 files changed, 64 insertions, 39 deletions
diff --git a/h-source/Application/Controllers/AcquisitioncardsController.php b/h-source/Application/Controllers/AcquisitioncardsController.php
index 08e99f0..f908d8e 100644
--- a/h-source/Application/Controllers/AcquisitioncardsController.php
+++ b/h-source/Application/Controllers/AcquisitioncardsController.php
@@ -66,6 +66,9 @@ class AcquisitioncardsController extends GenericController
$data['intefaceOptions'] = $interfaceOptions;
$data['worksOptions'] = $worksOptions;
$data['worksField'] = $worksField;
+
+ $data['notFoundString'] = "No acquisition card found";
+
$this->append($data);
}
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);
diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php
index 6f1fac4..ecd7318 100644
--- a/h-source/Application/Include/languages.php
+++ b/h-source/Application/Include/languages.php
@@ -335,6 +335,13 @@ class Lang
/*0287*/"November" => "novembre",
/*0288*/"December" => "dicembre",
/*0289*/"not-specified" => "non specificato",
+ /*0290*/"last-inserted" => "ultimo inserito",
+ /*0291*/"last inserted" => "ultimo inserito",
+ /*0292*/"alphabetically" => "alfabeticamente",
+ /*0293*/"alphabetically-desc" => "alfabeticamente decresc",
+ /*0294*/"alphabetically desc" => "alfabeticamente decresc",
+ /*0295*/"undef" => "tutti",
+ /*0296*/"All" => "Tutti",
),
'es' => array
(
diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php
index bb7aa5f..e90a163 100644
--- a/h-source/Application/Include/myFunctions.php
+++ b/h-source/Application/Include/myFunctions.php
@@ -451,4 +451,20 @@ function getDiffArray($associativeArray, $oldArray, $newArray)
}
}
return $diffArray;
+}
+
+//get the translation function
+function getTranslationFunction($fieldName)
+{
+ $fieldsFunc = array(
+ "vendor" => "betterVendor",
+ "interface" => "translate",
+ );
+
+ if (array_key_exists($fieldName,$fieldsFunc))
+ {
+ return $fieldsFunc[$fieldName];
+ }
+
+ return "gtext";
} \ No newline at end of file
diff --git a/h-source/Application/Models/GenericModel.php b/h-source/Application/Models/GenericModel.php
index 002149b..64f24be 100644
--- a/h-source/Application/Models/GenericModel.php
+++ b/h-source/Application/Models/GenericModel.php
@@ -72,33 +72,25 @@ class GenericModel extends Model_Tree {
{
foreach ($this->_popupItemNames as $name => $field)
{
- $this->_popupFunctions[$name] = $this->getTranslationFunction($name);
+ $this->_popupFunctions[$name] = getTranslationFunction($name);
}
}
+ //get the HTML of the popup labels
public function getPopupLabel($viewArgs)
{
$html = null;
+ $listArray = array('page','history_page');
+
foreach ($viewArgs as $field => $value)
{
- $html .= "<div class='viewall_popup_menu_status_item'>$value</div>\n";
+ if (!in_array($field,$listArray))
+ {
+ $value = getTranslationFunction($field) !== 'gtext' ? gtext(call_user_func(getTranslationFunction($field),$value)) : gtext($value);
+ $html .= "<div class='viewall_popup_menu_status_item'>".$value."</div>\n";
+ }
}
return $html;
}
- //get the translation function
- public function getTranslationFunction($fieldName)
- {
- $fieldsFunc = array(
- "vendor" => "betterVendor",
- "interface" => "translate",
- );
-
- if (array_key_exists($fieldName,$fieldsFunc))
- {
- return $fieldsFunc[$fieldName];
- }
-
- return "gtext";
- }
} \ No newline at end of file
diff --git a/h-source/Application/Views/Acquisitioncards/catalogue.php b/h-source/Application/Views/Acquisitioncards/catalogue.php
index f9d86d7..23ce477 100644
--- a/h-source/Application/Views/Acquisitioncards/catalogue.php
+++ b/h-source/Application/Views/Acquisitioncards/catalogue.php
@@ -25,18 +25,14 @@
<?php echo $popup;?>
</div>
<div class="viewall_popup_menu_status">
- <div class="viewall_popup_menu_status_item"><?php echo betterVendor($this->viewArgs['vendor'])?></div>
- <div class="viewall_popup_menu_status_item"><?php echo $this->viewArgs['comm_year']?></div>
- <div class="viewall_popup_menu_status_item"><?php echo $this->viewArgs['compatibility']?></div>
- <div class="viewall_popup_menu_status_item"><?php echo $this->viewArgs['interface']?></div>
- <div class="viewall_popup_menu_status_item"><?php echo $this->viewArgs['sort-by']?></div>
+ <?php echo $popupLabel;?>
</div>
</div>
<!--if no notebooks found-->
<?php if (strcmp($recordNumber,0) === 0) { ?>
<div class="viewall_no_items_found">
- <?php echo gtext("No acquisition card found");?>..
+ <?php echo gtext($notFoundString);?>..
</div>
<?php } ?>
@@ -62,17 +58,17 @@
<div class="notebook_vendor">
<div class="inner_label"><?php echo gtext("year of commercialization");?>:</div>
- <div class="inner_value"><b><?php echo $item['hardware']['comm_year'];?></b></div>
+ <div class="inner_value"><b><?php echo gtext($item['hardware']['comm_year']);?></b></div>
</div>
<div class="notebook_vendor">
<div class="inner_label"><?php echo gtext("interface");?>:</div>
- <div class="inner_value"><b><?php echo $item['hardware']['interface'];?></b></div>
+ <div class="inner_value"><b><?php echo gtext(translate($item['hardware']['interface']));?></b></div>
</div>
<div class="notebook_kernel">
<div class="inner_label"><?php echo gtext("does it work with free software?");?></div>
- <div class="inner_value"><b><?php echo $item['hardware']['compatibility'];?></b></div>
+ <div class="inner_value"><b><?php echo gtext($item['hardware'][$worksField]);?></b></div>
</div>
<div class="notebook_view_link">
diff --git a/h-source/Application/Views/page.php b/h-source/Application/Views/page.php
index e879d0e..0cf4e34 100644
--- a/h-source/Application/Views/page.php
+++ b/h-source/Application/Views/page.php
@@ -97,22 +97,22 @@
<?php if (strcmp($this->controller,'videocards') === 0 ) { ?>
<div class="inner_label"><?php echo gtext("how does it work with free software?");?></div>
- <div class="inner_value"><b><?php echo Videocard::$videoReverse[$item[$tableName][$worksField]];?></b></div>
+ <div class="inner_value"><b><?php echo gtext(Videocard::$videoReverse[$item[$tableName][$worksField]]);?></b></div>
<?php } else if (strcmp($this->controller,'printers') === 0 ) { ?>
<div class="inner_label"><?php echo gtext("compatibility with free software");?>:</div>
- <div class="inner_value"><b><?php echo $item[$tableName]['compatibility'];?></b> <a class="open_help_window" target="blank" title="compatibility help page" href="<?php echo $this->baseUrl."/help/index/$lang#printer-compatibility";?>"><img class="top_left_images_help" src="<?php echo $this->baseUrl;?>/Public/Img/Acun/help_hint.png"></a></div>
+ <div class="inner_value"><b><?php echo gtext($item[$tableName]['compatibility']);?></b> <a class="open_help_window" target="blank" title="compatibility help page" href="<?php echo $this->baseUrl."/help/index/$lang#printer-compatibility";?>"><img class="top_left_images_help" src="<?php echo $this->baseUrl;?>/Public/Img/Acun/help_hint.png"></a></div>
<?php } else if (strcmp($this->controller,'scanners') === 0 ) { ?>
<div class="inner_label"><?php echo gtext("compatibility with free software");?>:</div>
- <div class="inner_value"><b><?php echo $item[$tableName]['compatibility'];?></b> <a class="open_help_window" target="blank" title="compatibility help page" href="<?php echo $this->baseUrl."/help/index/$lang#scanner-compatibility";?>"><img class="top_left_images_help" src="<?php echo $this->baseUrl;?>/Public/Img/Acun/help_hint.png"></a></div>
+ <div class="inner_value"><b><?php echo gtext($item[$tableName]['compatibility']);?></b> <a class="open_help_window" target="blank" title="compatibility help page" href="<?php echo $this->baseUrl."/help/index/$lang#scanner-compatibility";?>"><img class="top_left_images_help" src="<?php echo $this->baseUrl;?>/Public/Img/Acun/help_hint.png"></a></div>
<?php } else { ?>
<div class="inner_label"><?php echo gtext("does it work with free software?");?></div>
- <div class="inner_value"><b><?php echo $item[$tableName][$worksField];?></b></div>
+ <div class="inner_value"><b><?php echo gtext($item[$tableName][$worksField]);?></b></div>
<?php } ?>
diff --git a/h-source/Public/Css/main.css b/h-source/Public/Css/main.css
index 4ad368a..301be3b 100644
--- a/h-source/Public/Css/main.css
+++ b/h-source/Public/Css/main.css
@@ -560,7 +560,7 @@ div.history_page_list_news a
{
clear:left;
width:725px;
- overflow:hidden;
+/* overflow:hidden; */
margin-left:0px;
text-align:center;
}