{"id":21802073,"url":"https://github.com/php-translation/extractor","last_synced_at":"2025-04-07T01:09:58.648Z","repository":{"id":13767127,"uuid":"74902021","full_name":"php-translation/extractor","owner":"php-translation","description":"Extracts translation strings from source code","archived":false,"fork":false,"pushed_at":"2024-10-02T18:11:10.000Z","size":302,"stargazers_count":127,"open_issues_count":17,"forks_count":33,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-30T09:02:02.228Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/php-translation.png","metadata":{"files":{"readme":"Readme.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE","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":"2016-11-27T17:10:12.000Z","updated_at":"2025-01-30T20:50:11.000Z","dependencies_parsed_at":"2022-08-07T07:15:41.684Z","dependency_job_id":"26652dcd-5084-47b8-960b-4cdbb8aa8147","html_url":"https://github.com/php-translation/extractor","commit_stats":{"total_commits":149,"total_committers":25,"mean_commits":5.96,"dds":"0.49664429530201337","last_synced_commit":"174b7a4b6ac0f79da0b207db5cd9ed3bc4eab47a"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-translation%2Fextractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-translation%2Fextractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-translation%2Fextractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-translation%2Fextractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/php-translation","download_url":"https://codeload.github.com/php-translation/extractor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411267,"owners_count":20934650,"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":[],"created_at":"2024-11-27T11:22:35.353Z","updated_at":"2025-04-07T01:09:58.628Z","avatar_url":"https://github.com/php-translation.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Translation extractor\n\n[![Latest Version](https://img.shields.io/github/release/php-translation/extractor.svg?style=flat-square)](https://github.com/php-translation/extractor/releases)\n[![Total Downloads](https://img.shields.io/packagist/dt/php-translation/extractor.svg?style=flat-square)](https://packagist.org/packages/php-translation/extractor)\n\n**Extract translation messages from source code**\n\n\n## Install\n\nVia Composer:\n\n```bash\n$ composer require php-translation/extractor\n```\n\n## Usage\n\n```php\n$extractor = new Extractor();\n\n// Create an extractor for PHP files\n$fileExtractor = new PHPFileExtractor();\n\n// Add visitors\n$fileExtractor-\u003eaddVisitor(new ContainerAwareTrans());\n$fileExtractor-\u003eaddVisitor(new ContainerAwareTransChoice());\n$fileExtractor-\u003eaddVisitor(new FlashMessage());\n$fileExtractor-\u003eaddVisitor(new FormTypeChoices());\n\n// Add the file extractor to Extactor\n$extractor-\u003eaddFileExtractor($fileExtractor);\n\n// Define where the source code is\n$finder = new Finder();\n$finder-\u003ein('/foo/bar');\n\n//Start extracting files\n$sourceCollection = $extractor-\u003eextract($finder);\n```\n\n## Found an issue?\n\nIs it something we do not extract? Please add it as a test. Add a new file with your example code in\n`tests/Resources/Github/Issue_XX.php`, then edit the `AllExtractorsTest` to make sure the translation\nkey is found:\n\n```php\n// ...\n$this-\u003etranslationExists($sc, 'trans.issue_xx');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-translation%2Fextractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-translation%2Fextractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-translation%2Fextractor/lists"}