src/Viserio/Component/Translation/Translator.php
protected function collectMessage(
        ?string $locale,
        string $domain,
        string $id,
        string $translation,
        array $parameters = []
    ): void {
        $catalogue = $this->catalogue;

        if ($catalogue->defines($id, $domain)) {
            $state = self::MESSAGE_DEFINED;
        } elseif ($catalogue->has($id, $domain)) {
            $state             = self::MESSAGE_EQUALS_FALLBACK;
            $fallbackCatalogue = $catalogue->getFallbackCatalogue();

            while ($fallbackCatalogue) {
                if ($fallbackCatalogue->defines($id, $domain)) {
                    $locale = $fallbackCatalogue->getLocale();

                    break;
                }

                $fallbackCatalogue = $fallbackCatalogue->getFallbackCatalogue();
            }
        } else {
            $state = self::MESSAGE_MISSING;
        }

        $this->messages[] = [
            'locale'      => $locale,
            'domain'      => $domain,
            'id'          => $id,
            'translation' => $translation,
            'parameters'  => $parameters,
            'state'       => $state,
        ];
    }
protected function collectMessage(
        ?string $locale,
        string $domain,
        string $id,
        string $translation,
        array $parameters = []
    ): void {
        $catalogue = $this->catalogue;

        if ($catalogue->defines($id, $domain)) {
            $state = self::MESSAGE_DEFINED;
        } elseif ($catalogue->has($id, $domain)) {
            $state             = self::MESSAGE_EQUALS_FALLBACK;
            $fallbackCatalogue = $catalogue->getFallbackCatalogue();

            while ($fallbackCatalogue) {
                if ($fallbackCatalogue->defines($id, $domain)) {
                    $locale = $fallbackCatalogue->getLocale();

                    break;
                }

                $fallbackCatalogue = $fallbackCatalogue->getFallbackCatalogue();
            }
        } else {
            $state = self::MESSAGE_MISSING;
        }

        $this->messages[] = [
            'locale'      => $locale,
            'domain'      => $domain,
            'id'          => $id,
            'translation' => $translation,
            'parameters'  => $parameters,
            'state'       => $state,
        ];
    }
Collect messages about all translations.

@param null|string $locale
@param string      $domain
@param string      $id
@param string      $translation
@param array       $parameters

@return void