PHPackages                             dereuromark/cakephp-translate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. dereuromark/cakephp-translate

ActiveCakephp-plugin[Admin Panels](/categories/admin)

dereuromark/cakephp-translate
=============================

A CakePHP plugin for managing translations

0.4.5(1mo ago)1712.3k2[2 issues](https://github.com/dereuromark/cakephp-translate/issues)MITPHPPHP &gt;=8.3CI passing

Since Oct 6Pushed 6d ago1 watchersCompare

[ Source](https://github.com/dereuromark/cakephp-translate)[ Packagist](https://packagist.org/packages/dereuromark/cakephp-translate)[ Docs](https://github.com/dereuromark/cakephp-translate)[ RSS](/packages/dereuromark-cakephp-translate/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (48)Versions (19)Used By (0)

CakePHP Translate Plugin
========================

[](#cakephp-translate-plugin)

[![CI](https://github.com/dereuromark/cakephp-translate/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/dereuromark/cakephp-translate/actions/workflows/ci.yml?query=branch%3Amaster)[![Coverage Status](https://camo.githubusercontent.com/49f187bc7b4ee48911dc3417805280971dfa008a1dbc9525ebb416c85bd59b9d/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6465726575726f6d61726b2f63616b657068702d7472616e736c6174652f6d61737465722e737667)](https://codecov.io/github/dereuromark/cakephp-translate/branch/master)[![PHPStan](https://camo.githubusercontent.com/f60d96f7c2579690ab6dfa8918f777fe93a02a92301c661eb38a85861a92b780/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230382d627269676874677265656e2e7376673f7374796c653d666c6174)](https://phpstan.org/)[![Latest Stable Version](https://camo.githubusercontent.com/78d5ab362b052cf8ec63c77fd9e988a2e93586690576e9863d677a4360790f41/68747470733a2f2f706f7365722e707567782e6f72672f6465726575726f6d61726b2f63616b657068702d7472616e736c6174652f762f737461626c652e737667)](https://packagist.org/packages/dereuromark/cakephp-translate)[![Minimum PHP Version](https://camo.githubusercontent.com/79ac187c3223b8ca823e61529e5b4b0d13fce915b009c6dd61e3767beb5acc0d/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e332d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/aa6ffb6c521ad9ebdee3bdc93205846d50832848fb16eed7f1cc5bc3b7a24940/68747470733a2f2f706f7365722e707567782e6f72672f6465726575726f6d61726b2f63616b657068702d7472616e736c6174652f6c6963656e73652e737667)](https://packagist.org/packages/dereuromark/cakephp-translate)[![Total Downloads](https://camo.githubusercontent.com/7dc5b3bfade5aba814d1dcea397fe018518d24d5e1f62b515499d44feecf423f/68747470733a2f2f706f7365722e707567782e6f72672f6465726575726f6d61726b2f63616b657068702d7472616e736c6174652f642f746f74616c2e737667)](https://packagist.org/packages/dereuromark/cakephp-translate)[![Coding Standards](https://camo.githubusercontent.com/dbabe22710e675cb88cd0b12196f1477e2376dea497332775692cf1359a75918/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f63732d5053522d2d322d2d522d79656c6c6f772e737667)](https://github.com/php-fig-rectified/fig-rectified-standards)

A CakePHP plugin for managing translations DB driven.

This branch is for use with **CakePHP 5.1+**. For details see [version map](https://github.com/dereuromark/cakephp-translate/wiki#cakephp-version-map).

Key features
------------

[](#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.
- Run i18n extract directly from web interface (with dry run support).
- Multi-project support with project-specific locale paths.
- Translation coverage dashboard with progress tracking.
- PO/POT file analyzer for detecting issues.
- **TranslateBehavior CRUD**: Manage translations in `*_i18n` and `*_translations` tables with auto-translate and glossary support.

Benefits over normal PO editing
-------------------------------

[](#benefits-over-normal-po-editing)

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

Included translation services via APIs
--------------------------------------

[](#included-translation-services-via-apis)

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

Add your translation engine here [in a heartbeat](docs#add-your-own-implementation).

Installation
------------

[](#installation)

Including the plugin is pretty much as with every other CakePHP plugin:

```
composer require dereuromark/cakephp-translate
```

Then, to load the plugin run the following command:

```
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.

Run this in console to create the necessary DB tables:

```
bin/cake migrations migrate -p Translate

```

### Recommendations

[](#recommendations)

Use `dereuromark/cakephp-queue` for larger projects to avoid timeout issues when importing PO files.

Usage
-----

[](#usage)

Web Backend

- Navigate to `/admin/translate/` in your browser.

CLI

- Run `bin/cake translate`.

### TranslateBehavior Support

[](#translatebehavior-support)

This plugin now includes comprehensive support for CakePHP's built-in TranslateBehavior and shadow table (`_i18n`) management - all in one unified interface.

Navigate to `/admin/translate/translate-behavior` for:

- **View All Shadow Tables**: See all existing `_i18n` tables and their translation data
- **Detect Behavior Usage**: Automatically detect which models are using CakePHP's TranslateBehavior
- **Find Candidates**: Discover tables with translatable fields that don't yet have translation support
- **Generate Migrations**: Create shadow table migrations with just a few clicks

**Features**:

- Choose between **Shadow Table** (better performance, recommended) or **EAV** (more flexible) strategies
- Select which fields to translate from your existing tables
- Get complete, ready-to-use migration code with proper indexes and constraints
- Step-by-step instructions for adding the behavior to your Table class
- Automatic detection of translatable text fields
- Preview of shadow table schemas and translation data
- Shows which locales are in use
- Identifies orphaned shadow tables (shadow tables without base tables)

**Example workflow**:

1. Navigate to `/admin/translate/translate-behavior`
2. Click "Generate Migration" on a candidate table (e.g., `articles`)
3. Select fields to translate (e.g., `title`, `body`)
4. Choose strategy (Shadow Table is default and recommended)
5. Copy generated migration code
6. Save to `config/Migrations/AddI18nForArticles.php`
7. Run `bin/cake migrations migrate`
8. Add behavior to your ArticlesTable class

Accessible from the main dashboard under "Quick Actions".

### TranslateBehavior Entries CRUD

[](#translatebehavior-entries-crud)

Manage individual translation entries in your TranslateBehavior tables directly from the web interface.

Navigate to `/admin/translate/i18n-entries` for:

- **Overview Dashboard**: See all translation tables with entry counts and strategies
- **List &amp; Filter**: Browse entries by locale, field, or translation type
- **Edit Translations**: Modify individual translation entries
- **Batch Auto-Translate**: Translate multiple entries using configured translation engine
- **Glossary Suggestions**: Get translation suggestions from your existing PO files

**Supported Table Strategies**:

- **EAV** (`*_i18n` tables): Entity-Attribute-Value with `foreign_key`, `field`, `content` columns
- **ShadowTable** (`*_translations` tables): Direct field columns like `name`, `description`

**Auto Field Support**: Tables with an `auto` boolean column can track machine vs. manual translations:

- Machine translations (`auto = true`) can be safely re-translated
- Manual edits (`auto = false`) are protected from automatic overwrites
- Filter entries by translation type for quality review

See [I18nEntries Documentation](docs/I18nEntries.md) for detailed usage.

### Web-based i18n Extract

[](#web-based-i18n-extract)

Run CakePHP's i18n extract command directly from the web interface without needing CLI access.

Navigate to `/admin/translate/translate-strings/run-extract` for:

- **Dry Run Mode**: Preview extracted strings before writing files
- **Custom Paths**: Specify which directories to scan
- **Plugin Support**: Automatic domain detection for plugin-type projects
- **Live Output**: See extraction progress and results in real-time

**Features**:

- Extracts to temp directory first, then copies to final location (ensures consistent behavior)
- For plugins, automatically uses the plugin name as domain (e.g., `translate.pot` for Translate plugin)
- Filters out unwanted POT files (like `default.pot`) for plugin projects
- Shows string count and preview of generated POT files
- Supports merge and overwrite options

**Example workflow**:

1. Navigate to `/admin/translate/translate-strings/run-extract`
2. Configure paths to scan (defaults to `src/` and `templates/`)
3. Enable "Dry run" to preview first
4. Review the extracted strings
5. Disable "Dry run" and run again to write files
6. Import the generated POT file via the Extract/Import page

### PO File Analyzer

[](#po-file-analyzer)

Analyze PO/POT files for common issues and inconsistencies.

Navigate to `/admin/translate/translate-strings/analyze` to:

- Upload or paste PO file content
- Select from existing project PO/POT files
- Detect formatting issues, missing translations, fuzzy entries
- Identify placeholder mismatches between source and translation

### Translation Coverage

[](#translation-coverage)

The main dashboard shows translation coverage across all domains and locales:

- Progress bars for each language
- Counts of translated vs. total strings
- Quick links to untranslated strings
- Batch confirm functionality for reviewed translations

Tips
----

[](#tips)

- Use [TinyAuth](https://github.com/dereuromark/cakephp-tinyauth) or Cake Authentication plugin 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
-------------------------------

[](#configuration-and-documentation)

- [Documentation](docs)

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance94

Actively maintained with recent releases

Popularity34

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 97.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~253 days

Recently: every ~39 days

Total

12

Last Release

39d ago

PHP version history (3 changes)0.1PHP &gt;=5.6

0.2PHP &gt;=7.3

0.3.0PHP &gt;=8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39854?v=4)[Mark Scherer](/maintainers/dereuromark)[@dereuromark](https://github.com/dereuromark)

---

Top Contributors

[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (211 commits)")[![ravage84](https://avatars.githubusercontent.com/u/625761?v=4)](https://github.com/ravage84 "ravage84 (3 commits)")[![cdvrooman](https://avatars.githubusercontent.com/u/61364?v=4)](https://github.com/cdvrooman "cdvrooman (2 commits)")[![alexvanniel](https://avatars.githubusercontent.com/u/3951148?v=4)](https://github.com/alexvanniel "alexvanniel (1 commits)")

---

Tags

cakephpcakephp-plugini18npo-filestranslationpluginlocalizationi18ntranslationsl10ncakephpadmin-panelpo-filesstandalone-ui

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dereuromark-cakephp-translate/health.svg)

```
[![Health](https://phpackages.com/badges/dereuromark-cakephp-translate/health.svg)](https://phpackages.com/packages/dereuromark-cakephp-translate)
```

###  Alternatives

[dereuromark/cakephp-setup

A CakePHP plugin containing lots of useful management tools

36199.6k2](/packages/dereuromark-cakephp-setup)[dereuromark/cakephp-queue

The Queue plugin for CakePHP provides deferred task execution.

308954.9k25](/packages/dereuromark-cakephp-queue)[dereuromark/cakephp-tags

Tags plugin for CakePHP

1764.8k1](/packages/dereuromark-cakephp-tags)[dereuromark/cakephp-databaselog

A CakePHP plugin for storing and viewing application logs in the database

44172.5k2](/packages/dereuromark-cakephp-databaselog)[gettext/languages

gettext languages with plural rules

7832.7M12](/packages/gettext-languages)[dereuromark/cakephp-geo

A CakePHP plugin around geocoding tools and helpers.

51186.8k6](/packages/dereuromark-cakephp-geo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
