Kdyby\Translation\PrefixedTranslator::translate PHP Метод

translate() публичный Метод

public translate ( string $message, integer | array | null $count = NULL, array | string | null $parameters = [], string | null $domain = NULL, string | null $locale = NULL ) : string
$message string
$count integer | array | null
$parameters array | string | null
$domain string | null
$locale string | null
Результат string
    public function translate($message, $count = NULL, $parameters = [], $domain = NULL, $locale = NULL)
    {
        $translationString = $message instanceof Phrase ? $message->message : $message;
        $prefix = $this->prefix . '.';
        if (Strings::startsWith($message, '//')) {
            $prefix = NULL;
            $translationString = Strings::substring($translationString, 2);
        }
        if ($message instanceof Phrase) {
            return $this->translator->translate(new Phrase($prefix . $translationString, $message->count, $message->parameters, $message->domain, $message->locale));
        }
        if (is_array($count)) {
            $locale = $domain ?: NULL;
            $domain = $parameters ?: NULL;
            $parameters = $count ?: [];
            $count = NULL;
        }
        return $this->translator->translate($prefix . $translationString, $count, (array) $parameters, $domain, $locale);
    }