Git Product home page Git Product logo

civistrings's Introduction

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.

Requirements

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.

Simply download civistrings and put it somewhere in the PATH, eg

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.

Download: Git + Composer

To download the source tree and all dependencies, use git and composer, e.g.

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.

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.

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

Build

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

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

civistrings's People

Contributors

bjendres avatar demeritcowboy avatar joshuakissoon avatar mlutfy avatar seamuslee001 avatar totten avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.