src/Viserio/Component/Parser/Dumper/PoDumper.php
public function dump(array $data): string
    {
        $output = '';

        [$data, $output] = $this->addHeaderToOutput($data, $output);

        $entriesCount = \count($data);
        $counter      = 0;

        foreach ($data as $entry) {
            [$entry, $output] = $this->addPreviousToOutput($entry, $output);
            [$entry, $output] = $this->addTCommentToOutput($entry, $output);
            [$entry, $output] = $this->addCcommentToOutput($entry, $output);
            [$entry, $output] = $this->addReferencesToOutput($entry, $output);
            [$entry, $output] = $this->addFlagsToOutput($entry, $output);

            if (isset($entry['@'])) {
                $output .= '#@ ' . $entry['@'] . $this->eol;
            }

            if (isset($entry['msgctxt']) && \count($entry['msgctxt']) !== 0) {
                $output .= 'msgctxt ' . $this->cleanExport($entry['msgctxt'][0]) . $this->eol;
            }

            $isObsolete = isset($entry['obsolete']) && $entry['obsolete'];
            $isPlural   = isset($entry['msgid_plural']);

            if ($isObsolete) {
                $output .= '#~ ';
            }

            [$entry, $output] = $this->addMsgidToOutput($entry, $output, $isObsolete);
            [$entry, $output] = $this->addMsgidPluralToOutput($entry, $output);

            $output = $this->addMsgstrToOutput($entry, $isPlural, $output, $isObsolete);

            $counter++;

            // Avoid inserting an extra newline at end of file
            if ($counter < $entriesCount) {
                $output .= $this->eol;
            }
        }

        return $output;
    }
public function dump(array $data): string
    {
        $output = '';

        [$data, $output] = $this->addHeaderToOutput($data, $output);

        $entriesCount = \count($data);
        $counter      = 0;

        foreach ($data as $entry) {
            [$entry, $output] = $this->addPreviousToOutput($entry, $output);
            [$entry, $output] = $this->addTCommentToOutput($entry, $output);
            [$entry, $output] = $this->addCcommentToOutput($entry, $output);
            [$entry, $output] = $this->addReferencesToOutput($entry, $output);
            [$entry, $output] = $this->addFlagsToOutput($entry, $output);

            if (isset($entry['@'])) {
                $output .= '#@ ' . $entry['@'] . $this->eol;
            }

            if (isset($entry['msgctxt']) && \count($entry['msgctxt']) !== 0) {
                $output .= 'msgctxt ' . $this->cleanExport($entry['msgctxt'][0]) . $this->eol;
            }

            $isObsolete = isset($entry['obsolete']) && $entry['obsolete'];
            $isPlural   = isset($entry['msgid_plural']);

            if ($isObsolete) {
                $output .= '#~ ';
            }

            [$entry, $output] = $this->addMsgidToOutput($entry, $output, $isObsolete);
            [$entry, $output] = $this->addMsgidPluralToOutput($entry, $output);

            $output = $this->addMsgstrToOutput($entry, $isPlural, $output, $isObsolete);

            $counter++;

            // Avoid inserting an extra newline at end of file
            if ($counter < $entriesCount) {
                $output .= $this->eol;
            }
        }

        return $output;
    }
{@inheritdoc}

array[]
['headers']        array  If a multi-line header is provided
than the value is a array else a string (optional)
array[]
['msgid']        array  ID of the message.
['msgstr']       array  Message translation.
['msgctxt']      array  Message context.                      (optional)
['tcomment']     array  Comment from translator.              (optional)
['ccomment']     array  Extracted comments from code.         (optional)
['references']   array  Location of string in code.           (optional)
['obsolete']     bool   Is the message obsolete?              (optional)
['fuzzy']        bool   Is the message "fuzzy"?               (optional)
['flags']        array  Flags of the entry.                   (optional)
['previous']     array                                        (optional)
['msgid']    string This is a previous string
['msgstr']   string This is a previous translation string
['msgid_plural'] array  The plural string                     (optional)
['msgstr[0]']    array  The string when the number is equal
['msgstr[1]']    array  The string when the number is equal