public function translate($message, ... $parameters): string {
    $count = $parameters[0] ?? 0;
    $params = $parameters[1] ?? [];
    list($domain, $m) = $this->extractDomainAndMessage($message);
    $texts = Arrays::get($this->loader->getTexts(), $domain, []);
    $parts = explode(".", $m);
    if(count($parts) === 1) {
      $parts = [$m];
    }
    $text = $this->multiLevelTrans($parts, $texts);
    if($text === "") {
      $this->onUntranslated($message);
      return $message;
    }
    if($this->messageSelector->isMultiChoice($text)) {
      $text = $this->messageSelector->choose($text, $count);
    }
    $params["count"] = $count;
    foreach($params as $key => $value) {
      $text = str_replace("%$key%", $value, $text);
    }
    return $text;
  }
public function translate($message, ... $parameters): string {
    $count = $parameters[0] ?? 0;
    $params = $parameters[1] ?? [];
    list($domain, $m) = $this->extractDomainAndMessage($message);
    $texts = Arrays::get($this->loader->getTexts(), $domain, []);
    $parts = explode(".", $m);
    if(count($parts) === 1) {
      $parts = [$m];
    }
    $text = $this->multiLevelTrans($parts, $texts);
    if($text === "") {
      $this->onUntranslated($message);
      return $message;
    }
    if($this->messageSelector->isMultiChoice($text)) {
      $text = $this->messageSelector->choose($text, $count);
    }
    $params["count"] = $count;
    foreach($params as $key => $value) {
      $text = str_replace("%$key%", $value, $text);
    }
    return $text;
  }
public function translate ( $ message , ... $ parameters ) : string { $ count = $ parameters [ 0 ] ?? 0 ; $ params = $ parameters [ 1 ] ?? [ ] ; list ( $ domain , $ m ) = $ this -> extractDomainAndMessage ( $ message ) ; $ texts = Arrays :: get ( $ this -> loader -> getTexts ( ) , $ domain , [ ] ) ; $ parts = explode ( "." , $ m ) ; if ( count ( $ parts ) === 1 ) { $ parts = [ $ m ] ; } $ text = $ this -> multiLevelTrans ( $ parts , $ texts ) ; if ( $ text === "" ) { $ this -> onUntranslated ( $ message ) ; return $ message ; } if ( $ this -> messageSelector -> isMultiChoice ( $ text ) ) { $ text = $ this -> messageSelector -> choose ( $ text , $ count ) ; } $ params [ "count" ] = $ count ; foreach ( $ params as $ key => $ value ) { $ text = str_replace ( "%$key%" , $ value , $ text ) ; } return $ text ; }
Translate the string

@param string $message
Translate the string