summaryrefslogtreecommitdiff
path: root/framework/I18N
diff options
context:
space:
mode:
authoruacaman <>2011-05-04 20:49:27 +0000
committeruacaman <>2011-05-04 20:49:27 +0000
commitff3de9649f1b9ce04f685d25e3df2277927e7ff7 (patch)
tree287a96e2ace7ecd414a5a831213482b6eaa1a1d1 /framework/I18N
parent39f417b6977a3264d5df16f383d8ba0b182b229a (diff)
Issue 234:
Controls now honor THttpResponse configured HtmlWriterType.
Diffstat (limited to 'framework/I18N')
-rw-r--r--framework/I18N/TTranslate.php7
-rw-r--r--framework/I18N/TTranslateParameter.php6
2 files changed, 6 insertions, 7 deletions
diff --git a/framework/I18N/TTranslate.php b/framework/I18N/TTranslate.php
index a444aeba..0ea340f4 100644
--- a/framework/I18N/TTranslate.php
+++ b/framework/I18N/TTranslate.php
@@ -201,8 +201,7 @@ class TTranslate extends TI18NControl
*/
public function render($writer)
{
- $textWriter=new TTextWriter;
- $htmlWriter=new THtmlWriter($textWriter);
+ $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
$subs = array();
foreach($this->getParameters() as $key => $value)
$subs['{'.$key.'}'] = $value;
@@ -213,12 +212,12 @@ class TTranslate extends TI18NControl
elseif($control instanceof TControl)
$control->render($htmlWriter);
elseif(is_string($control))
- $textWriter->write($control);
+ $htmlWriter->write($control);
}
$text = $this->getText();
if(strlen($text)==0)
- $text = $textWriter->flush();
+ $text = $htmlWriter->flush();
if($this->getTrim())
$text = trim($text);
diff --git a/framework/I18N/TTranslateParameter.php b/framework/I18N/TTranslateParameter.php
index 37443133..8172ff03 100644
--- a/framework/I18N/TTranslateParameter.php
+++ b/framework/I18N/TTranslateParameter.php
@@ -110,10 +110,10 @@ class TTranslateParameter extends TControl
$value = $this->getValue();
if(strlen($value) > 0)
return $value;
- $textWriter = new TTextWriter;
- $this->renderControl(new THtmlWriter($textWriter));
+ $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
+ $this->renderControl($htmlWriter);
return $this->getTrim() ?
- trim($textWriter->flush()) : $textWriter->flush();
+ trim($htmlWriter->flush()) : $htmlWriter->flush();
}
}