PHPackages                             brazvo/gettext-php-scanner - 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. brazvo/gettext-php-scanner

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

brazvo/gettext-php-scanner
==========================

Php scanner and generator of .po files or .php files with prepared translations.

1.0.2(10y ago)22951GPL-3.0PHPPHP &gt;=5.3.0

Since Mar 29Pushed 10y ago1 watchersCompare

[ Source](https://github.com/brazvo/gettext-php-scanner)[ Packagist](https://packagist.org/packages/brazvo/gettext-php-scanner)[ RSS](/packages/brazvo-gettext-php-scanner/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (4)Used By (0)

GetText PHP Scanner
===================

[](#gettext-php-scanner)

Created by Branislav Zvolensky  Based on orginal source code of Eslam Mahmoud   github:

Description
-----------

[](#description)

The class to scan files/project and create or update .po file or .php file, used for localization. Could be used to scan any type of files, It will extract all strings like \_\_('Hello World'), \_e("Hello again"), \_e("Hello again %s", $param), \_t('Hello onc again'), -&gt;t('... and again').

Original code was refactored, namespaced, extended of php array generator and there were fixed or covered some use cases such us:

- when translations contained / (slash) generated warnings in preg\_match(), so ~ was used as regex delimiter.
- when translations contained special characters such as .!() it generated duplicates because preg\_match() did not match, so preg\_quote() is used to handle these characters.
- Generator scanned in hidden directories such as .git or .svn, so hidden files and directories were excluded from scan.
- Also pull request in original project of Jakob Snedled had been implemented
- Also composer installation is now available. See bellow.

How to use it?
--------------

[](#how-to-use-it)

```
