src/I18n/GettextPoFile.php
protected function loadAll()
    {
        if (!isset($this->filePath)) {
            throw new InvalidConfigException("Not specified '\$filePath' parameter");
        }
        $pattern = '/(msgctxt\s+"(.*?(?<!\\\\))")?\s+' // context
            . 'msgid\s+((?:".*(?<!\\\\)"\s*)+)\s+' // message ID, i.e. original string
            . 'msgstr\s+((?:".*(?<!\\\\)"\s*)+)/'; // translated string
        $content = file_get_contents($this->filePath);
        $matches = [];
        $matchCount = preg_match_all($pattern, $content, $matches);

        $this->_messages = [];

        for ($i = 0; $i < $matchCount; ++$i) {
            $id = $this->decode($matches[3][$i]);
            $message = $this->decode($matches[4][$i]);
            $context = $matches[2][$i];
            if (!isset($this->_messages[$context])) {
                $this->_messages[$context] = [];
            }
            $this->_messages[$context][$id] = $message;
        }

        return $this->_messages;
    }
protected function loadAll()
    {
        if (!isset($this->filePath)) {
            throw new InvalidConfigException("Not specified '\$filePath' parameter");
        }
        $pattern = '/(msgctxt\s+"(.*?(?<!\\\\))")?\s+' // context
            . 'msgid\s+((?:".*(?<!\\\\)"\s*)+)\s+' // message ID, i.e. original string
            . 'msgstr\s+((?:".*(?<!\\\\)"\s*)+)/'; // translated string
        $content = file_get_contents($this->filePath);
        $matches = [];
        $matchCount = preg_match_all($pattern, $content, $matches);

        $this->_messages = [];

        for ($i = 0; $i < $matchCount; ++$i) {
            $id = $this->decode($matches[3][$i]);
            $message = $this->decode($matches[4][$i]);
            $context = $matches[2][$i];
            if (!isset($this->_messages[$context])) {
                $this->_messages[$context] = [];
            }
            $this->_messages[$context][$id] = $message;
        }

        return $this->_messages;
    }
Get all messages from file
@return array
@throws InvalidConfigException