2017 © Pedro Peláez
 

cakephp-plugin cakephp-transifex

The Transifex plugin allows you to pull translations from Transifex Translation API.

image

dereuromark/cakephp-transifex

The Transifex plugin allows you to pull translations from Transifex Translation API.

  • Friday, June 24, 2016
  • by dereuromark
  • Repository
  • 1 Watchers
  • 14 Stars
  • 7,494 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

CakePHP Transifex Plugin

Build Status Coverage Status Minimum PHP Version License Total Downloads Coding Standards, (*1)

A CakePHP 3.x plugin that works with Transifex and pulls/pushes translations. It uses the Transifex API v2., (*2)

Please note: New functionality has been tested against latest CakePHP 3.x version only. Please upgrade if possible., (*3)

Installation

Installing the plugin is pretty much as with every other CakePHP plugin., (*4)

  • composer require dereuromark/cakephp-transifex
  • Make sure you have Plugin::load('Transifex') or Plugin::loadAll() in your bootstrap

Create an account at transifex.com and create/join a project and resources., (*5)

Put the information regarding project, user and password in your config file or your bootstrap, (*6)

$config['Transifex'] = [
    'project' => 'cakephp',
    'user' => '...',
    'password' => '...'
];

That's it. It should be up and running., (*7)

Usage

To get a list of supported resources for the current project:, (*8)

cake Transifex.Transifex resources

To get a list of supported languages:, (*9)

cake Transifex.Transifex languages

Statistics for a resource can be gathered using, (*10)

cake Transifex.Transifex statistics

To actually update your Locale folder, use, (*11)

cake Transifex.Transifex pull

It will prompt for language and resource (use * to import all)., (*12)

A shortcut to import a specific language for a specific resource, you can also use, (*13)

cake Transifex.Transifex pull -l {language} -r {resource}

The PO files will be stored in src/Locale/{locale}/LC_MESSAGES/{resource}.po. Using version control is highly recommended to quickly overview and confirm the changes made., (*14)

Advanced usage

You can pull reviewed translations only using --reviewed-only or -R:, (*15)

cake Transifex.Transifex pull -R

To pull locales for a plugin you need to set --plugin or -p:, (*16)

cake Transifex.Transifex pull -p Tools

They will then be stored in the plugin's Locale folder., (*17)

If you happen to have one primary project and several other (plugin or CakePHP core) projects, you can overwrite the config project setting using --project or -P:, (*18)

cake Transifex.Transifex pull -P cakephp

Tip: If you want to dry-run it first, use -d -v. This will not modify your locale files but simulate the import., (*19)

Tips

You can use the auto-alias of Transifex.Transifex which is Transifex - or even a super-short t using custom aliasing., (*20)

Debugging

Use --debug to have more verbose debugging output when pushing via cURL., (*21)

Testing

When testing --debug enables live test mode and uses the actual API instead of mocking and fake JSON response files. Make sure you provide valid credentials in your tests/bootstrap.php for this. Also make sure those are not your live credentials to avoid data loss. You should use a dedicated test account here to be sure., (*22)

TODO

  • More tests

Disclaimer

Use at your own risk. Please provide any fixes or enhancements via issue or better pull request., (*23)

The Versions

24/06 2016

dev-master

9999999-dev http://github.com/dereuromark/cakephp-transifex

The Transifex plugin allows you to pull translations from Transifex Translation API.

  Sources   Download

MIT

The Requires

 

The Development Requires

19/05 2015

2.x-dev

2.9999999.9999999.9999999-dev http://github.com/dereuromark/cakephp-transifex

The Transifex plugin allows you to pull translations from Transifex Translation API.

  Sources   Download

MIT

The Requires

 

10/03 2015

1.2.0

1.2.0.0 http://github.com/dereuromark/cakephp-transifex

The Transifex plugin allows you to pull translations from Transifex Translation API.

  Sources   Download

MIT

The Requires

 

20/01 2015

1.1.0

1.1.0.0 http://github.com/dereuromark/cakephp-transifex

The Transifex plugin allows you to pull translations from Transifex Translation API.

  Sources   Download

MIT

The Requires

 

05/12 2014

1.0.0

1.0.0.0 http://github.com/dereuromark/cakephp-transifex

The Transifex plugin allows you to pull translations from Transifex Translation API.

  Sources   Download

MIT

The Requires