Skip to content

Migration guide from v4 to v5

Raúl Ferràs edited this page Feb 11, 2018 · 2 revisions

A lot of changes were made to v5 to improve usability on PoParser.

Namespace change

All classes were under the namespace Sepia.
It now goes all under Sepia\PoParser.

Components

Sepia\PoParser did too much work, it parsed, edited and dumped PO catalogs.
This has now been split into components:

  • Sepia\PoParser\Parser handles the parsing of a PO source data.
  • Sepia\PoParser\PoCompiler handles the dumping of a PO catalog back to a file.
  • Sepia\PoParser\Catalog\CatalogArray stores a collection of PO entries. It contains methods to read and modify them.

Parsing

Old PoParser class has received a lot of changes:

  • Constructor does not accept options anymore. Improvements in how entries are stored in the catalog, there's no need for multiline-glue nor context-glue to control how entries with Context or multi lines are saved in the catalog.
  • parser method now returns a Catalog. Optionally it accepts a Catalog as an input argument. The Parser class does not longer stores entries in a entries property.
Clone this wiki locally