{"id":29104682,"url":"https://github.com/pherrymason/php-po-parser","last_synced_at":"2025-06-29T00:06:56.159Z","repository":{"id":5433961,"uuid":"6626407","full_name":"pherrymason/PHP-po-parser","owner":"pherrymason","description":"Parse Gettext *.PO files with PHP","archived":false,"fork":false,"pushed_at":"2023-08-02T15:47:59.000Z","size":586,"stargazers_count":128,"open_issues_count":3,"forks_count":57,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-09-07T14:40:25.632Z","etag":null,"topics":["gettext","parser","po-files"],"latest_commit_sha":null,"homepage":"http://raulferras.github.io/PHP-po-parser/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pherrymason.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-11-10T10:19:30.000Z","updated_at":"2024-09-03T07:58:03.000Z","dependencies_parsed_at":"2024-06-18T11:28:38.774Z","dependency_job_id":null,"html_url":"https://github.com/pherrymason/PHP-po-parser","commit_stats":{"total_commits":176,"total_committers":27,"mean_commits":6.518518518518518,"dds":0.6477272727272727,"last_synced_commit":"a8db1b024ce27809c2178c1f5bf2d14504d33213"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/pherrymason/PHP-po-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pherrymason%2FPHP-po-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pherrymason%2FPHP-po-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pherrymason%2FPHP-po-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pherrymason%2FPHP-po-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pherrymason","download_url":"https://codeload.github.com/pherrymason/PHP-po-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pherrymason%2FPHP-po-parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262514195,"owners_count":23322698,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gettext","parser","po-files"],"created_at":"2025-06-29T00:06:54.970Z","updated_at":"2025-06-29T00:06:56.121Z","avatar_url":"https://github.com/pherrymason.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"PoParser\n=======\nPoParser is a personal project to fulfill a need I got: parse Gettext Portable files (*.po files) and edit its content using PHP.  \n\nPoParser requires PHP \u003e= 5.4, but may work in 5.3 too.  \n[Changelog](changelog.md)\n\n[![Latest Stable Version](https://poser.pugx.org/sepia/po-parser/v/stable)](https://packagist.org/packages/sepia/po-parser) \n[![Total Downloads](https://poser.pugx.org/sepia/po-parser/downloads)](https://packagist.org/packages/sepia/po-parser) \n[![License](https://poser.pugx.org/sepia/po-parser/license)](https://packagist.org/packages/sepia/po-parser) \n[![Build Status](https://travis-ci.org/raulferras/PHP-po-parser.png?branch=master)](https://travis-ci.org/raulferras/PHP-po-parser) \n[![Code Coverage](https://scrutinizer-ci.com/g/raulferras/PHP-po-parser/badges/coverage.png?s=a19ece2a8543b085ab1a5db319ded3bc4530b567)](https://scrutinizer-ci.com/g/raulferras/PHP-po-parser/) \n[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/raulferras/PHP-po-parser/badges/quality-score.png?s=6aaf3c31ce15cebd1d4bed718cd41fd2d921fd31)](https://scrutinizer-ci.com/g/raulferras/PHP-po-parser/) \n\n[![Gitter](https://badges.gitter.im/raulferras/PHP-po-parser.svg)](https://gitter.im/raulferras/PHP-po-parser?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\n\nFeatures\n========\nIt supports following parsing features:\n\n- header section.\n- msgid, both single and multiline.\n- msgstr, both single and multiline.\n- msgctxt (Message context).\n- msgid_plural (plurals forms).\n- #, keys (flags).\n- \u003cspan\u003e# keys (translator comments).\u003c/span\u003e\n- #. keys (Comments extracted from source code).\n- #: keys (references).\n- #| keys (previous strings), both single and multiline.\n- #~ keys (old entries), both single and multiline.\n\nInstallation\n============\n\n```\ncomposer require sepia/po-parser\n```\n\nUsage\n=====\n```php\n\u003c?php \n// Parse a po file\n$fileHandler = new Sepia\\PoParser\\SourceHandler\\FileSystem('es.po');\n\n$poParser = new Sepia\\PoParser\\Parser($fileHandler);\n$catalog  = $poParser-\u003eparse();\n\n// Get an entry\n$entry = $catalog-\u003egetEntry('welcome.user');\n\n// Update entry\n$entry = new Entry('welcome.user', 'Welcome User!');\n$catalog-\u003esetEntry($entry);\n\n// You can also modify other entry attributes as translator comments, code comments, flags...\n$entry-\u003esetTranslatorComments(array('This is shown whenever a new user registers in the website'));\n$entry-\u003esetFlags(array('fuzzy', 'php-code'));\n```\n\n## Save Changes back to a file\nUse `PoCompiler` together with `FileSystem` to save a catalog back to a file:\n \n```php\n$fileHandler = new Sepia\\PoParser\\SourceHandler\\FileSystem('en.po');\n$compiler = new Sepia\\PoParser\\PoCompiler();\n$fileHandler-\u003esave($compiler-\u003ecompile($catalog));\n```\n\nDocumentation\n=============\n- [v5 Documentation](https://github.com/raulferras/PHP-po-parser/wiki/Documentation-5.0)\n- [Migration guide from v4 to v5](https://github.com/raulferras/PHP-po-parser/wiki/Migration-v4-to-v5)\n- [v4 documentation](https://github.com/raulferras/PHP-po-parser/wiki/Documentation-4.0)\n\n\nTesting\n=======\nTests are done using PHPUnit.\nTo execute tests, from command line type: \n\n```\nphp vendor/bin/phpunit\n```\n\n\nTODO\n====\n* Add compatibility with older disambiguating contexts formats. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpherrymason%2Fphp-po-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpherrymason%2Fphp-po-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpherrymason%2Fphp-po-parser/lists"}