2017 © Pedro Peláez
 

library php-to-pot

Creates a .pot file for translations based off a directory of php files

image

owenmelbz/php-to-pot

Creates a .pot file for translations based off a directory of php files

  • Saturday, March 17, 2018
  • by OwenMelbz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 11 % Grown

The README.md

PHP to .POT Generator

This is a really simple command line tool which generates a .pot or .po file based off language strings that it finds within the defined directory., (*1)

Currently it simply accepts 2 paths, an input - which should be a directory of templates, and an output, which is typically a .pot file., (*2)

Installation

  1. composer install owenmelbz/php-to-pot

Optional

Create a composer script to save your little fingers e.g, (*3)

"scripts": {
    "makepot": "./vendor/bin/php-to-pot -i ./my-template-directory -o ./translation-template.pot"
}

You can then just run composer run makepot to generate your file when needed., (*4)

Usage

The tool has only 2 params, (*5)

  1. -i/--in (a directory containing files you want to generate translations from)
  2. -o/--out (the path/filename of the generated .pot)

e.g, (*6)

./vendor/bin/php-to-pot -i ./my-templates -o translation-template.pot

Support

  • Magento 2
  • Wordpress
  • Laravel Blade
  • Anything else that uses .php extension and a list of the following translation functions

__ n__ p__ _e d__ dn__ dp__ np__ dnp__ noop__ gettext ngettext pgettext dgettext dngettext dpgettext npgettext dnpgettext noop, (*7)

Disclaimer

Under the hood, this just interfaces with https://github.com/oscarotero/Gettext to allow developers to generate .pot files to send to translators to create the actual .po and .mo files., (*8)

The Versions

17/03 2018

dev-master

9999999-dev

Creates a .pot file for translations based off a directory of php files

  Sources   Download

MIT

The Requires

 

17/03 2018

0.0.3

0.0.3.0

Creates a .pot file for translations based off a directory of php files

  Sources   Download

MIT

The Requires

 

17/03 2018

0.0.2

0.0.2.0

Creates a .pot file for translations based off a directory of php files

  Sources   Download

MIT

The Requires

 

17/03 2018

0.0.1

0.0.1.0

Creates a .pot file for translations based off a directory of php files

  Sources   Download

MIT

The Requires