translateText() protected method

Translates the text with subsititution.
protected translateText ( $text, $subs ) : string
return string translated text
示例#1
0
 /**
  * Display the choosen translated string.
  * Overrides the parent method, also calls parent's renderBody to
  * translate.
  */
 protected function translateText($text, $subs)
 {
     $text = parent::translateText($text, $subs);
     $choice = new ChoiceFormat();
     $value = $this->getValue();
     $string = $choice->format($text, $value);
     if ($string) {
         return strtr($string, array('{Value}' => $value));
     }
 }