2017 © Pedro Peláez
 

cakephp-plugin cakephp-translate

A CakePHP plugin for managing translations

image

dereuromark/cakephp-translate

A CakePHP plugin for managing translations

  • Saturday, April 28, 2018
  • by dereuromark
  • Repository
  • 1 Watchers
  • 12 Stars
  • 89 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 8 Open issues
  • 2 Versions
  • 7 % Grown

The README.md

CakePHP Translate Plugin

CI Coverage Status Latest Stable Version Minimum PHP Version License Total Downloads Coding Standards, (*1)

A CakePHP plugin for managing translations DB driven., (*2)

This branch is for use with CakePHP 5.0+. For details see version map., (*3)

WARNING: Not fully upgraded yet, help needed!, (*4)

Key features

  • Import from POT, PO files or any service/API.
  • Web-based and without external dependencies.
  • Translate strings in all languages simultaneously.
  • Allow others to help translating without having to know technical details.
  • Auto-Translate and Auto-Suggest with Translate APIs (e.g. Google Translate PHP/JS, Yandex, ...) for efficiency.

Benefits over normal PO editing

  • Prevent duplicates, missing translations, collisions.
  • Auto-Features like trim(), h(), newlines to <p>/<br>, espacing of %s.
  • Validate placeholders ({0}, %s, ...).
  • Preview and code excerpts of references.
  • Auto-Add Controller names (singular + plural).
  • Manage in Groups (=Domains) and export/enable/disable them.
  • Creates clean PO files with all translations in usage to easier diff changes.

Included translation services via APIs

  • Google (free, limited)
  • Yandex (free, limited)
  • Transltr (free)

Add your translation engine here in a heartbeat., (*5)

Installation

Including the plugin is pretty much as with every other CakePHP plugin:, (*6)

composer require dereuromark/cakephp-translate

Then, to load the plugin run the following command:, (*7)

bin/cake plugin load Translate -b -r
# If you haven't loaded the Tools plugin already
bin/cake plugin load Tools -b -r

Routes are needed for the backed, the bootstrap sets up a few defaults., (*8)

Run this in console to create the necessary DB tables:, (*9)

bin/cake migrations migrate -p Translate

Recommendations

Use dereuromark/cakephp-queue for larger projects to avoid timeout issues when importing PO files., (*10)

Usage

Web Backend - Navigate to /admin/translate/ in your browser., (*11)

CLI - Run bin/cake translate., (*12)

Tips

  • Use TinyAuth or alike to manage access to the translation backend for user groups.
  • Implement your own Translation engine if you want to have even better auto-suggest.

Configuration and documentation

The Versions