Download the PHP package maxakawizard/gettext-parser without Composer
On this page you can find all versions of the php package maxakawizard/gettext-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download maxakawizard/gettext-parser
More information about maxakawizard/gettext-parser
Files in maxakawizard/gettext-parser
Package gettext-parser
Short Description Gettext parser for Windows
License MIT
Homepage https://github.com/MAXakaWIZARD/GettextParser
Informations about the package gettext-parser
Source code parser for Poedit
Library for syncing gettext catalogs with Smarty and Javascript sources.
Poedit already has parser for *.php files out of the box.
Library parses files and writes results as php files, whose are processed by Poedit PHP parser.
This package is compliant with PSR-4, PSR-1, and PSR-2. If you notice compliance oversights, please send a patch via pull request.
Installation
- Download sources and unpack to any folder.
- If needed, create
config.phpfile (seeconfig.php.dist) and specify path toxgettextbinary
Supported formats
JavaScript
jQuery.gettext plugin:
Smarty
block.t plugin:
native:
Usage
- Create new parser in
Poedit:File->Preferences->Parsers->New - Update your gettext catalog:
Catalogue->Update from sources
Parser params:
Smarty
- Language:
Smarty - Parser command:
php.exe -f "/path/to/GettextParser/index.php" Smarty %o %C %K %F - List of extensions:
*.tpl - An item in keywords list:
-k%k - An item in input files list:
%f - Source code charset:
--from-code=%c
JavaScript
- Language:
JavaScript - Parser command:
php.exe -f "/path/to/GettextParser/index.php" JavaScript %o %C %K %F - List of extensions:
*.js - An item in keywords list:
-k%k - An item in input files list:
%f - Source code charset:
--from-code=%c
Known issues
- plurals are not supported for Smarty (planned)
Contributing
Contribution is highly encouraged! Just send your pull-requests or create issues.
Tests
Library is covered with unit tests.
For running those tests you'll need PHPUnit.
It's recommended to use phpunit.phar.
Just specify tests/phpunit.xml.dist as config file for PHPUnit (actually it can found it automatically):
License
This library is released under MIT license.

