Parses file in PO format
Saves a translation item to the messages.
Parses portable object (PO) format.
_addMessage(array $messages, array $item): void
Saves a translation item to the messages.
array
$messages The messages array being collected from the file
array
$item The current item being inspected
void
parse(string $resource): array
Parses portable object (PO) format.
From https://www.gnu.org/software/gettext/manual/gettext.html#PO-Files we should be able to parse files having:
white-space
msgid untranslated-string msgstr translated-string
extra or different lines are:
msgctxt context
msgid untranslated-string-singular msgid_plural untranslated-string-plural msgstr[0] translated-string-case-0 ... msgstr[N] translated-string-case-n
The definition states:
This parser sacrifices some features of the reference implementation the differences to that implementation are as follows.
Items with an empty id are ignored.
string
$resource The file name to parse
array
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/class-Cake.I18n.Parser.PoFileParser.html