PHPackages                             maxakawizard/po-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. maxakawizard/po-parser

ActiveLibrary[Localization &amp; i18n](/categories/localization)

maxakawizard/po-parser
======================

Gettext \*.po parser for PHP

1.4.0(3y ago)1771.5k↓16.2%7[3 issues](https://github.com/MAXakaWIZARD/PoParser/issues)[1 PRs](https://github.com/MAXakaWIZARD/PoParser/pulls)MITPHPPHP &gt;=7.1

Since Mar 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/MAXakaWIZARD/PoParser)[ Packagist](https://packagist.org/packages/maxakawizard/po-parser)[ Docs](http://github.com/MAXakaWIZARD/PoParser)[ RSS](/packages/maxakawizard-po-parser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (12)Used By (0)

PoParser
========

[](#poparser)

[![Build](https://github.com/MAXakaWIZARD/PoParser/actions/workflows/ci.yml/badge.svg)](https://github.com/MAXakaWIZARD/PoParser/actions)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b15f635ebe581f22f8222036c4814e9e14a6564a90c0912324065af3946462f5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4d4158616b6157495a4152442f506f5061727365722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/MAXakaWIZARD/PoParser/?branch=master)[![Code Climate](https://camo.githubusercontent.com/26e4de8ef40b18964ca51272dec2e2c829e6ece7d12a72c047d2d099c26a24ab/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f4d4158616b6157495a4152442f506f5061727365722f6261646765732f6770612e737667)](https://codeclimate.com/github/MAXakaWIZARD/PoParser)[![Coverage Status](https://camo.githubusercontent.com/5712bfb30a3e5fe45560ef3698ef9556de60ff488c2324fa327ae1b2cbf14c69/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f4d4158616b6157495a4152442f506f5061727365722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/MAXakaWIZARD/PoParser?branch=master)

[![GitHub tag](https://camo.githubusercontent.com/cc7b519000e3459cab8fe0f08dda43d37ce4ba8d4a71ad5ad46ff756457973ca/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f4d4158616b6157495a4152442f506f5061727365722e7376673f6c6162656c3d6c6174657374)](https://packagist.org/packages/maxakawizard/po-parser)[![Packagist](https://camo.githubusercontent.com/7cb0b9a23e9be98f1a20f11cac965ea0b3689fa7698cc8f2058318a7bf07fd90/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6178616b6177697a6172642f706f2d7061727365722e737667)](https://packagist.org/packages/maxakawizard/po-parser)[![Packagist](https://camo.githubusercontent.com/f2776d8231dc596ac39032811f756a7e62a0f88ce1cab352fb8cb0c1c9ff743e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6d6178616b6177697a6172642f706f2d7061727365722e737667)](https://packagist.org/packages/maxakawizard/po-parser)

[![Minimum PHP Version](https://camo.githubusercontent.com/be3b30c4ceb47b639794ebe0895f4fec6871dd53b2d7ae58d654a2018c3844fb/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e312d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/05712d6c13315da424ced6ac57fd34f9c3ea6f3bdf82be83cc4877496d27912c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6178616b6177697a6172642f706f2d7061727365722e737667)](https://packagist.org/packages/maxakawizard/po-parser)

Gettext \*.po files parser for PHP.

This package is compliant with [PSR-4](http://www.php-fig.org/psr/4/) autoloading standard and [PSR-12](http://www.php-fig.org/psr/12/) coding standard. If you notice compliance oversights, please send a patch via pull request.

Usage
-----

[](#usage)

### Read file content

[](#read-file-content)

```
$parser = new PoParser\Parser();
$parser->read('my-pofile.po');
$entries = $parser->getEntriesAsArrays();
// Now $entries contains every string information in your pofile

echo '';
foreach ($entries as $entry) {
   echo ''.
   'msgid: '.$entry['msgid'].''.         // Message ID
   'msgstr: '.$entry['msgstr'].''.       // Translation
   'reference: '.$entry['reference'].''. // Reference
   'msgctxt: ' . $entry['msgctxt'].''.   // Message Context
   'tcomment: ' . $entry['tcomment'].''. // Translator comment
   'ccomment: ' . $entry['ccomment'].''. // Code Comment
   'obsolete?: '.(string)$entry['obsolete'].''. // Is obsolete?
    'fuzzy?: ' .(string)$entry['fuzzy'].     // Is fuzzy?
    '';
}
echo '';
```

### Modify content

[](#modify-content)

```
$parser = new PoParser\Parser();
$parser->read('my-pofile.po');
// Entries are stored in array, so you can modify them.

// Use updateEntry method to change messages you want.
$parser->updateEntry('Write your email', 'Escribe tu email');
$parser->write('my-pofile.po');
```

Todo
----

[](#todo)

- Improve entries edit interface
- Ability to change any entry fields
- Discover what's the meaning of "#@ " line
- Fix multiline `msgstr` processing (for singular and plural entries)
- Implement previous untranslated strings support

License
-------

[](#license)

This library is released under [MIT](http://www.tldrlegal.com/license/mit-license) license.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 94.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~341 days

Recently: every ~660 days

Total

11

Last Release

1406d ago

PHP version history (2 changes)1.0PHP &gt;=5.3.0

1.3.0PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1138453?v=4)[Max Grigorian](/maintainers/MAXakaWIZARD)[@MAXakaWIZARD](https://github.com/MAXakaWIZARD)

---

Top Contributors

[![MAXakaWIZARD](https://avatars.githubusercontent.com/u/1138453?v=4)](https://github.com/MAXakaWIZARD "MAXakaWIZARD (68 commits)")[![TiMESPLiNTER](https://avatars.githubusercontent.com/u/598854?v=4)](https://github.com/TiMESPLiNTER "TiMESPLiNTER (3 commits)")[![dhm80](https://avatars.githubusercontent.com/u/4153514?v=4)](https://github.com/dhm80 "dhm80 (1 commits)")

---

Tags

i18nl10ngettextpo

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/maxakawizard-po-parser/health.svg)

```
[![Health](https://phpackages.com/badges/maxakawizard-po-parser/health.svg)](https://phpackages.com/packages/maxakawizard-po-parser)
```

###  Alternatives

[symfony/intl

Provides access to the localization data of the ICU library

2.6k199.8M1.1k](/packages/symfony-intl)[gettext/gettext

PHP gettext manager

70130.2M102](/packages/gettext-gettext)[sepia/po-parser

Gettext \*.PO file parser for PHP.

1271.5M19](/packages/sepia-po-parser)[gettext/languages

gettext languages with plural rules

7530.3M11](/packages/gettext-languages)[fisharebest/localization

A lightweight localization database and translation tools, with data from the CLDR, IANA, ISO, etc.

3191.1k2](/packages/fisharebest-localization)[kunststube/potools

Tools for working with gettext PO files.

132.9k1](/packages/kunststube-potools)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
