Index: HeadTitle.php
===================================================================
--- HeadTitle.php (revision 9303)
+++ HeadTitle.php (working copy)
@@ -19,6 +19,9 @@
* @license http: */
+/** Zend_Registry */
+require_once 'Zend/Registry.php';
+
/** Zend_View_Helper_Placeholder_Container_Standalone */
require_once 'Zend/View/Helper/Placeholder/Container/Standalone.php';
@@ -65,18 +68,28 @@
/**
* Turn helper into string
*
- * @param string|null $indent
+ * @param string|null $indent
+ * @param string|null $locale
* @return string
*/
- public function toString($indent = null)
+ public function toString($indent = null, $locale = null)
{
$indent = (null !== $indent)
? $this->getWhitespace($indent)
: $this->getIndent();
$items = array();
- foreach ($this as $item) {
- $items[] = $this->_escape($item);
+
+ if(Zend_Registry::isRegistered('Zend_Translate')) {
+ $translator = Zend_Registry::get('Zend_Translate');
+
+ foreach ($this as $item) {
+ $items[] = $this->_escape($translator->translate($item, $locale));
+ }
+ } else {
+ foreach ($this as $item) {
+ $items[] = $this->_escape($item);
+ }
}
$separator = $this->_escape($this->getSeparator());
I think a better solution would be to have an accessor via which you can enable or disable translation:
I'm going to schedule this for the next minor release.