Download the PHP package smarty-gettext/tsmarty2c without Composer
On this page you can find all versions of the php package smarty-gettext/tsmarty2c. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download smarty-gettext/tsmarty2c
More information about smarty-gettext/tsmarty2c
Files in smarty-gettext/tsmarty2c
Package tsmarty2c
Short Description Smarty Gettext Translation String Ripper
License BSD-3-Clause
Homepage https://github.com/smarty-gettext/tsmarty2c
Informations about the package tsmarty2c
tsmarty2c.php - the command line utility
tsmarty2c.php
- A command line utility that rips gettext strings from smarty source files and converts them to .pot
(PO-Template).
This utility will scan templates for {t}...{/t}
placeholders for translation strings
and output a .pot
file (.po
template).
Usage:
./vendor/bin/tsmarty2c.php -o template.pot <filename or directory> <file2> <...>
If a parameter is a directory, the template files within will be parsed, recursively.
In output special PO tags are added that inform about location of extracted translation. Most of the PO edit tools can respect that information.
If you wish to scan also .php
or .phtml
files for native gettext calls, you may wish to combine result of tsmarty2c
and xgettext
calls:
By default tsmarty2c
scans for .tpl
files, if you wish to use other files, you can use xargs
in unix:
See how it's done in Eventum project.
Installing
-
as package depdencency:
composer require --dev smarty-gettext/tsmarty2c ./vendor/bin/tsmarty2c.php
-
directly from this repository
git clone https://github.com/smarty-gettext/tsmarty2c cd tsmarty2c composer install --no-dev ./bin/tsmarty2c.php
Developing
- clone this repository
- get composer
- install composer dependencies:
php composer.phar install
- start using it:
php bin/tsmarty2c.php
All versions of tsmarty2c with dependencies
php Version ^5.5.9 || ^7.0
smarty-gettext/smarty-gettext Version ^1.5.0
smarty/smarty Version <3.1.35
symfony/console Version ^3.2|^4|^5
symfony/finder Version ^2.8|^3.0|^4|^5