2017 © Pedro Peláez
 

library translate

g4 i18n php library

image

g4/translate

g4 i18n php library

  • Thursday, December 28, 2017
  • by g4code
  • Repository
  • 14 Watchers
  • 0 Stars
  • 5,723 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 18 Versions
  • 8 % Grown

The README.md

Translate

  • Configuration of the gettext extension
  • Utlity tool to generate .mo files
  • Utility tool for extracting template strings

Install

Using Composer and Packagist, (*1)

composer require g4/translate

Resources

  • Twig The i18n Extension http://twig.sensiolabs.org/doc/extensions/i18n.html
  • PHP gettext extension http://fr.php.net/manual/en/function.gettext.php

Requirements

  • "twig/twig" https://packagist.org/packages/twig/twig
  • "twig/extensions" https://packagist.org/packages/twig/extensions

Usage

Set locale early in the program before rendering any internationalized template., (*2)

use G4\Translate\Locale\Locale;
use G4\Translate\Locale\Options;

$options = new Options();
$options
    ->setDomain('myDomain')
    ->setLocale('en_US')
    ->setPath('/path/to/locale/files');
(new Locale($options))->set();

Command line interface

Convert .po files to .mo, (*3)

./vendor/bin/translate --path /path/to/locale/files

where --path is path to your locale folder, (*4)

Extract template strings, (*5)

./vendor/bin/translate-extract -t /path/to/templates -w /path/to/tmp -g /path/to/locale/files -d myDomain

where: * -t is path to folder that contains templates * -w is path to temp folder * -g is path to folder where myDomain.po file with strings will be generated * -d domain name, (*6)

Development

Install dependencies

$ make install

Run tests

$ make test

License

(The MIT License) see LICENSE file for details..., (*7)

The Versions

28/12 2017

dev-master

9999999-dev

g4 i18n php library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Drasko Gomboc
by Dejan Samardzija
by Ivan Krickovic

i18n languages translate

13/12 2017

0.8.0

0.8.0.0

g4 i18n php library

  Sources   Download

MIT

The Requires

 

by Drasko Gomboc
by Dejan Samardzija
by Ivan Krickovic

i18n languages translate

07/12 2017

dev-develop

dev-develop

g4 i18n php library

  Sources   Download

MIT

The Requires

 

by Drasko Gomboc
by Dejan Samardzija
by Ivan Krickovic

i18n languages translate

07/12 2017

0.7.0

0.7.0.0

g4 i18n php library

  Sources   Download

MIT

The Requires

 

by Drasko Gomboc
by Dejan Samardzija
by Ivan Krickovic

i18n languages translate

18/09 2017

0.6.0

0.6.0.0

g4 i18n php library

  Sources   Download

MIT

The Requires

 

by Drasko Gomboc
by Dejan Samardzija
by Ivan Krickovic

i18n languages translate

18/07 2017

0.5.0

0.5.0.0

g4 i18n php library

  Sources   Download

MIT

The Requires

 

by Drasko Gomboc
by Dejan Samardzija
by Ivan Krickovic

i18n languages translate

08/06 2016

0.4.2

0.4.2.0

g4 i18n php library

  Sources   Download

MIT

The Requires

 

by Drasko Gomboc
by Dejan Samardzija
by Ivan Krickovic

i18n languages translate

07/06 2016

0.4.1

0.4.1.0

g4 i18n php library

  Sources   Download

MIT

The Requires

 

by Drasko Gomboc
by Dejan Samardzija
by Ivan Krickovic

i18n languages translate

01/06 2016

0.4.0

0.4.0.0

g4 i18n php library

  Sources   Download

MIT

The Requires

 

by Drasko Gomboc
by Dejan Samardzija
by Ivan Krickovic

i18n languages translate

26/08 2015

0.3.1

0.3.1.0

g4 i18n php library

  Sources   Download

MIT

The Requires

 

by Drasko Gomboc
by Dejan Samardzija
by Ivan Krickovic

i18n languages translate

26/08 2015

0.3.0

0.3.0.0

g4 i18n php library

  Sources   Download

MIT

The Requires

 

by Drasko Gomboc
by Dejan Samardzija
by Ivan Krickovic

i18n languages translate

26/08 2015

0.2.3

0.2.3.0

g4 i18n php library

  Sources   Download

MIT

The Requires

 

by Drasko Gomboc
by Dejan Samardzija
by Ivan Krickovic

i18n languages translate

25/08 2015

0.2.2

0.2.2.0

g4 i18n php library

  Sources   Download

MIT

The Requires

 

by Drasko Gomboc
by Dejan Samardzija
by Ivan Krickovic

i18n languages translate

25/08 2015

0.2.1

0.2.1.0

g4 i18n php library

  Sources   Download

MIT

The Requires

 

by Drasko Gomboc
by Dejan Samardzija
by Ivan Krickovic

i18n languages translate

24/08 2015

0.2.0

0.2.0.0

g4 i18n php library

  Sources   Download

MIT

The Requires

 

by Drasko Gomboc
by Dejan Samardzija
by Ivan Krickovic

i18n languages translate

24/08 2015

0.1.1

0.1.1.0

g4 i18n php library

  Sources   Download

MIT

The Requires

 

by Drasko Gomboc
by Dejan Samardzija
by Ivan Krickovic

i18n languages translate

24/08 2015

0.1.0

0.1.0.0

g4 i18n php library

  Sources   Download

MIT

The Requires

 

by Drasko Gomboc
by Dejan Samardzija
by Ivan Krickovic

i18n languages translate

21/08 2015

0.0.1

0.0.1.0

g4 i18n php library

  Sources   Download

MIT

The Requires

 

by Drasko Gomboc
by Dejan Samardzija
by Ivan Krickovic

i18n languages translate