2017 © Pedro Peláez
 

library strings

String extractor for CiviCRM

image

civicrm/strings

String extractor for CiviCRM

  • Wednesday, April 11, 2018
  • by totten
  • Repository
  • 14 Watchers
  • 3 Stars
  • 617 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

civistrings

civistrings is the string extractor for CiviCRM core and CiviCRM extensions. It scans PHP, Smarty, JS, and partial HTML files for references to the ts() function -- and generates a list of strings using gettext's POT file format., (*1)

Requirements

  • PHP 7.4+
  • Composer (http://getcomposer.org)

Download: Single Executable (PHAR)

civistrings is distributed in PHAR format, which is a portable executable file (for PHP). It should run on most Unix-like systems where PHP 5.3+ is installed., (*2)

Simply download civistrings and put it somewhere in the PATH, eg, (*3)

sudo curl -LsS https://download.civicrm.org/civistrings/civistrings.phar -o /usr/local/bin/civistrings
sudo chmod +x /usr/local/bin/civistrings

To upgrade an existing installation, re-download the latest civistrings.phar., (*4)

Download: Git + Composer

To download the source tree and all dependencies, use git and composer, e.g., (*5)

git clone git://github.com/civicrm/civistrings.git
cd civistrings
composer install

The main executable is bin/civistrings. You may execute that file directly, or add the bin/ folder to PATH, e.g., (*6)

export PATH=/home/myuser/civistrings/bin:$PATH

Usage

## Scan all recognizable files under "myfolder/"
civistrings -o myfile.pot myfolder

## Scan all *.js files
find -name '*.js' | civistrings - -o myfile.pot

Development and Testing

The "examples" folder includes a series of example input files and expected output files. To see if the examples are correctly processed, simply run phpunit., (*7)

If you need to add new examples or change the behavior of the test, update tests/Command/ExtractCommandTest.php., (*8)

Build

To build a new copy of civistrings.phar from source, install git, composer, and box and run:, (*9)

git clone git://github.com/civicrm/civistrings.git
cd civistrings
composer install
php -dphar.readonly=0 `which box` build

The Versions

11/04 2018

dev-master

9999999-dev

String extractor for CiviCRM

  Sources   Download

GPL-2+

The Requires

 

The Development Requires

by CiviCRM