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.

018PHP

Since Aug 20Pushed 8mo 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 1mo 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

19

—

LowBetter than 10% of packages

Maintenance42

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity15

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://www.gravatar.com/avatar/69a75d4e38e78c763aa3ecd8f2cf5f011cb8a736963482e1f378716ba1792ed9?d=identicon)[zvezdak](/maintainers/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

[symfony/translation

Provides tools to internationalize your application

6.6k836.5M2.1k](/packages/symfony-translation)[nesbot/carbon

An API extension for DateTime that supports 281 different languages.

169661.4M4.8k](/packages/nesbot-carbon)[joedixon/laravel-translation

A tool for managing all of your Laravel translations

717911.4k11](/packages/joedixon-laravel-translation)[illuminate/translation

The Illuminate Translation package.

6936.4M494](/packages/illuminate-translation)[lajax/yii2-translate-manager

Translation management extension for Yii 2

227578.8k13](/packages/lajax-yii2-translate-manager)[larswiegers/laravel-translations-checker

Make sure your laravel translations are checked and are included in all languages.

256423.2k2](/packages/larswiegers-laravel-translations-checker)

PHPackages © 2026

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