PHPackages                             zvezda/cakephp-i18n - 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. [Localization &amp; i18n](/categories/localization)
4. /
5. zvezda/cakephp-i18n

ActiveCakephp-plugin[Localization &amp; i18n](/categories/localization)

zvezda/cakephp-i18n
===================

A CakePHP5 plugin for I18n related tools.

020PHP

Since Aug 20Pushed 12mo agoCompare

[ Source](https://github.com/zvezdak/cakephp-i18n)[ Packagist](https://packagist.org/packages/zvezda/cakephp-i18n)[ RSS](/packages/zvezda-cakephp-i18n/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

Introduction
============

[](#introduction)

This plugin provides tools for internationalization in CakePHP 5:

I18nRoute – generate and match routes with language prefixes (/{lang}/{controller}/{action}).

I18nMiddleware – automatically sets locale via I18n::setLocale() based on URL prefix and optionally redirects root / to default or browser-detected language.

DbMessagesLoader – load translation messages from the database instead of .po/.mo files.

Validation translation – auto-translate validation messages.

TimezoneWidget – generate a box of timezones grouped by region. Installation composer require zvezda/cakephp-i18n Usage Load Plugin In CakePHP 5, use Application.php to load plugins: // src/Application.php public function bootstrap(): void { parent::bootstrap(); $this-&gt;addPlugin(\\ADmad\\I18n\\Plugin::class); } I18nRoute Define routes with language prefix: use ADmad\\I18n\\Routing\\I18nRoute; $routes-&gt;scope('/', function ($routes) { $routes-&gt;connect( '/{controller}', \['action' =&gt; 'index'\], \['routeClass' =&gt; I18nRoute::class\] ); $routes-&gt;connect( '/{controller}/{action}/\*', \[\], \['routeClass' =&gt; I18nRoute::class\] ); }); Set supported languages in config/app.php: return \[ 'I18n' =&gt; \[ 'languages' =&gt; \['en', 'fr', 'de'\] \] \]; I18nMiddleware Configure middleware in Application::middleware(): use ADmad\\I18n\\Middleware\\I18nMiddleware; $middlewareQueue-&gt;add(new I18nMiddleware(\[ 'detectLanguage' =&gt; true, 'defaultLanguage' =&gt; 'en', 'languages' =&gt; \[ 'en' =&gt; \['locale' =&gt; 'en\_US'\], 'fr' =&gt; \['locale' =&gt; 'fr\_FR'\], \], \])); Notes: Add after RoutingMiddleware. Configure a root route / to prevent missing route errors: $routes-&gt;connect('/', \['controller' =&gt; 'Pages', 'action' =&gt; 'display', 'home'\]); DbMessagesLoader Store translation messages in the database instead of .po files. Create i18n\_messages table using the SQL file in config/. Configure loader in config/bootstrap.php: use ADmad\\I18n\\I18n\\DbMessagesLoader; use Cake\\I18n\\I18n; I18n::config('default', function ($domain, $locale) { $loader = new DbMessagesLoader($domain, $locale); return $loader(); }); Extract messages from code: bin/cake admad/i18n extract --languages en,fr,de TimezoneWidget Register in AppView: $this-&gt;loadHelper('Form', \[ 'widgets' =&gt; \[ 'timezone' =&gt; \['ADmad/I18n.Timezone'\], \], \]); Use in forms: // Full timezone list $this-&gt;Form-&gt;control('field', \['type' =&gt; 'timezone'\]); // Specific regions $this-&gt;Form-&gt;control('field', \[ 'type' =&gt; 'timezone', 'options' =&gt; \[ 'Asia' =&gt; DateTimeZone::ASIA, 'Europe' =&gt; DateTimeZone::EUROPE, \], \]);

###  Health Score

18

—

LowBetter than 7% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/106659211?v=4)[Zvezda Kirilova](/maintainers/zvezdak)[@zvezdak](https://github.com/zvezdak)

---

Top Contributors

[![ADmad](https://avatars.githubusercontent.com/u/142658?v=4)](https://github.com/ADmad "ADmad (239 commits)")[![zvezdak](https://avatars.githubusercontent.com/u/106659211?v=4)](https://github.com/zvezdak "zvezdak (3 commits)")[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (1 commits)")[![JD-Robbs](https://avatars.githubusercontent.com/u/5319760?v=4)](https://github.com/JD-Robbs "JD-Robbs (1 commits)")[![joshwyrick](https://avatars.githubusercontent.com/u/12661899?v=4)](https://github.com/joshwyrick "joshwyrick (1 commits)")[![romainbu](https://avatars.githubusercontent.com/u/12477600?v=4)](https://github.com/romainbu "romainbu (1 commits)")

### Embed Badge

![Health badge](/badges/zvezda-cakephp-i18n/health.svg)

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

###  Alternatives

[smarty-gettext/smarty-gettext

Gettext plugin enabling internationalization in Smarty Package files

752.5M8](/packages/smarty-gettext-smarty-gettext)[devaslanphp/auto-translate

Auto generate translation JSON files

6627.3k](/packages/devaslanphp-auto-translate)

PHPackages © 2026

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