src/Translator.php
private function translate(string $template, array $parameters): string
    {
        $placeholders = array_map([$this, 'getPlaceholder'], array_keys($parameters));
        $replacements = array_map([$this, 'getTranslatedValue'], array_values($parameters));

        return str_replace($placeholders, $replacements, $template);
    }
private function translate(string $template, array $parameters): string
    {
        $placeholders = array_map([$this, 'getPlaceholder'], array_keys($parameters));
        $replacements = array_map([$this, 'getTranslatedValue'], array_values($parameters));

        return str_replace($placeholders, $replacements, $template);
    }
private function translate ( string $ template , array $ parameters ) : string { $ placeholders = array_map ( [ $ this , 'getPlaceholder' ] , array_keys ( $ parameters ) ) ; $ replacements = array_map ( [ $ this , 'getTranslatedValue' ] , array_values ( $ parameters ) ) ; return str_replace ( $ placeholders , $ replacements , $ template ) ; }
Return a template with placeholders replaced by translated parameters
values.

@param string    $template
@param array     $parameters
@return string
Return a template with placeholders replaced by translated parameters values .