https://github.com/wisembly/xgettext-php
PHP xgettext implementation, currently javascript and handlebars parsers available
https://github.com/wisembly/xgettext-php
Last synced: 5 months ago
JSON representation
PHP xgettext implementation, currently javascript and handlebars parsers available
- Host: GitHub
- URL: https://github.com/wisembly/xgettext-php
- Owner: Wisembly
- License: mit
- Created: 2013-10-22T10:51:46.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2022-06-10T09:30:01.000Z (almost 4 years ago)
- Last Synced: 2025-01-31T20:52:02.132Z (about 1 year ago)
- Language: PHP
- Homepage:
- Size: 470 KB
- Stars: 16
- Watchers: 7
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Xgettext
[](https://travis-ci.org/Wisembly/xgettext-php)
xgettext PHP implementation. Curently provides 2 parsers:
- Javascript parser
- Handlebars parser
# Install
The recommended way to install Xgettext is through
[Composer](http://getcomposer.org/):
``` json
{
"require": {
"wisembly/xgettext-php": "@stable"
}
}
```
# Usage
## Parser
### Javascript parser
Simply create a new parser in Poedit (name it for example `Javascript`)`.
Then, set up xgettext like this:

**WARNING:** Javascript parser currently parse only 1rst and 2nd arguments. It
also do not parse strings with non matching parenthesis. (avoid smileys..)
### Handlebars parser
Same like above, just add `-l "handlebars"` in yout `xgettext` call to stipulate you want
to use handlebars parser with xgettext-php.

## JSON Dumper
```
$ bin/dumper -i input.po -o output.json
```
## Requirements
PHP >= 5.3
## Licence
Xgettext is released under the MIT License. See the bundled LICENSE file for details.