PHPackages                             cakephp/localized - 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. [Framework](/categories/framework)
4. /
5. cakephp/localized

ActiveCakephp-plugin[Framework](/categories/framework)

cakephp/localized
=================

CakePHP Localized Plugin

5.0.2(1y ago)218630.7k↓33.1%171[2 issues](https://github.com/cakephp/localized/issues)[2 PRs](https://github.com/cakephp/localized/pulls)5MITPHPPHP &gt;=8.1CI passing

Since Dec 6Pushed 2d ago36 watchersCompare

[ Source](https://github.com/cakephp/localized)[ Packagist](https://packagist.org/packages/cakephp/localized)[ Docs](https://github.com/cakephp/localized)[ RSS](/packages/cakephp-localized/feed)WikiDiscussions 5.x Synced yesterday

READMEChangelog (10)Dependencies (3)Versions (33)Used By (5)

CakePHP Localized plugin
========================

[](#cakephp-localized-plugin)

[![Build Status](https://github.com/cakephp/localized/actions/workflows/ci.yml/badge.svg)](https://github.com/cakephp/localized/actions/workflows/ci.yml/badge.svg)[![Coverage Status](https://camo.githubusercontent.com/6b47ae705ea7aa50f19239bbd42b009486c4185c7817352c956a53411c1a7067/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f63616b657068702f6c6f63616c697a65642f352e782e7376673f7374796c653d666c61742d737175617265)](https://app.codecov.io/gh/cakephp/localized/tree/5.x)[![Latest Stable Version](https://camo.githubusercontent.com/915919a1ecc489a31f7825fc7f344e99f08da7be9ca71c43b5efa418d9afb69a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f63616b657068702f6c6f63616c697a65643f736f72743d73656d766572267374796c653d666c61742d737175617265)](https://packagist.org/packages/cakephp/localized)[![Total Downloads](https://camo.githubusercontent.com/a92a667110607122253fbf478af9f54c0a420ffffe2a651bda1e0c6b13a6fef5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63616b657068702f6c6f63616c697a65643f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cakephp/localized/stats)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

This plugin contains various localized validation classes for specific countries.

Requirements
------------

[](#requirements)

This branch is for use with CakePHP **5.x**. See [version map](https://github.com/cakephp/localized/wiki#version-map) for details.

Demo
----

[](#demo)

See [sandbox.dereuromark.de/sandbox/localized](https://sandbox.dereuromark.de/sandbox/localized) for live sandbox demo on localized validation.

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

[](#installation)

You can install this plugin into your CakePHP application using [composer](https://getcomposer.org).

The recommended way to install composer packages is:

```
composer require cakephp/localized

```

Load your plugin using

```
bin/cake plugin load Cake/Localized

```

or by manually adding `'Cake/Localized'` to the array in your app's `config/plugins.php`.

Model validation
----------------

[](#model-validation)

Localized validation classes can be used for validating model fields.

```
namespace App\Model\Table;

use Cake\ORM\Table;
use Cake\Localized\Validation\FrValidation;
use Cake\Validation\Validator;

class PostsTable extends Table
{
    public function validationDefault(Validator $validator): Validator
    {
        $validator->setProvider('fr', FrValidation::class);
        $validator->add('phoneField', 'myCustomRuleNameForPhone', [
            'rule' => 'phone',
            'provider' => 'fr',
        ]);
    }
}
```

For further information on validation rules see the [CakePHP documentation on validation](https://book.cakephp.org/5/en/core-libraries/validation.html)

PO files
--------

[](#po-files)

This plugin also houses translations for the client-facing translated strings in the core (the `cake` domain). to use these files link or copy them into their expected location: `resources/locales//cake.po`

Contributing to Localized
-------------------------

[](#contributing-to-localized)

If you find that your country is not part of the Localized plugin, please fork the project on GitHub. Once you have forked the project you can commit your validator class (and any test cases). As soon as you have pushed your changes back to GitHub you can send a pull request and your changes will be reviewed and merged in, or feedback will be given.

### Validation methods

[](#validation-methods)

There are a few methods that are common to all classes, defined through the interface "ValidationInterface":

- `phone()` to check a phone number
- `postal()` to check a postal code
- `personId()` to check a country specific person ID

Please try to fit your validation rules in that naming scheme. Apart from that you can also define further validation methods in your implementing class, of course.

Issues with Localized
---------------------

[](#issues-with-localized)

If you have issues with Localized, you can report them at [github.com/cakephp/localized/issues](https://github.com/cakephp/localized/issues).

###  Health Score

66

—

FairBetter than 99% of packages

Maintenance71

Regular maintenance activity

Popularity58

Moderate usage in the ecosystem

Community41

Growing community involvement

Maturity83

Battle-tested with a long release history

 Bus Factor5

5 contributors hold 50%+ of commits

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 ~158 days

Recently: every ~233 days

Total

30

Last Release

2d ago

Major Versions

3.5.2 → 4.0.0-beta2020-04-02

2.x-dev → 3.x-dev2023-03-14

3.x-dev → 4.1.12023-09-04

4.1.1 → 5.0.0-RC2023-11-13

4.1.2 → 5.0.02023-12-12

PHP version history (7 changes)2.1.0PHP &gt;=5.2.8

2.4.0PHP &gt;=5.3

3.0.0PHP &gt;=5.4

3.5.0PHP &gt;=5.6

4.0.0-betaPHP &gt;=7.2

4.1.0PHP &gt;=7.3

5.0.0-RCPHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23666?v=4)[CakePHP](/maintainers/cakephp)[@cakephp](https://github.com/cakephp)

---

Top Contributors

[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (125 commits)")[![predominant](https://avatars.githubusercontent.com/u/24568?v=4)](https://github.com/predominant "predominant (46 commits)")[![antograssiot](https://avatars.githubusercontent.com/u/4977112?v=4)](https://github.com/antograssiot "antograssiot (31 commits)")[![cake17](https://avatars.githubusercontent.com/u/1652972?v=4)](https://github.com/cake17 "cake17 (27 commits)")[![AD7six](https://avatars.githubusercontent.com/u/33387?v=4)](https://github.com/AD7six "AD7six (25 commits)")[![renan](https://avatars.githubusercontent.com/u/28046?v=4)](https://github.com/renan "renan (24 commits)")[![ceeram](https://avatars.githubusercontent.com/u/111448?v=4)](https://github.com/ceeram "ceeram (20 commits)")[![elboletaire](https://avatars.githubusercontent.com/u/153305?v=4)](https://github.com/elboletaire "elboletaire (16 commits)")[![othercorey](https://avatars.githubusercontent.com/u/24221186?v=4)](https://github.com/othercorey "othercorey (16 commits)")[![gildonei](https://avatars.githubusercontent.com/u/1370979?v=4)](https://github.com/gildonei "gildonei (12 commits)")[![lorenzo](https://avatars.githubusercontent.com/u/37621?v=4)](https://github.com/lorenzo "lorenzo (12 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (12 commits)")[![Benfarhat](https://avatars.githubusercontent.com/u/1620009?v=4)](https://github.com/Benfarhat "Benfarhat (11 commits)")[![ADmad](https://avatars.githubusercontent.com/u/142658?v=4)](https://github.com/ADmad "ADmad (11 commits)")[![busgurlu](https://avatars.githubusercontent.com/u/1284742?v=4)](https://github.com/busgurlu "busgurlu (10 commits)")[![jrbasso](https://avatars.githubusercontent.com/u/26548?v=4)](https://github.com/jrbasso "jrbasso (8 commits)")[![Arhell](https://avatars.githubusercontent.com/u/26163841?v=4)](https://github.com/Arhell "Arhell (7 commits)")[![markstory](https://avatars.githubusercontent.com/u/24086?v=4)](https://github.com/markstory "markstory (7 commits)")[![slywalker](https://avatars.githubusercontent.com/u/54266?v=4)](https://github.com/slywalker "slywalker (6 commits)")[![annuh](https://avatars.githubusercontent.com/u/2487949?v=4)](https://github.com/annuh "annuh (6 commits)")

---

Tags

i18nl10ncakephplocalized

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[cakephp/debug_kit

CakePHP Debug Kit

86314.7M170](/packages/cakephp-debug-kit)[cakephp/bake

Bake plugin for CakePHP

11212.0M201](/packages/cakephp-bake)[dereuromark/cakephp-queue

The Queue plugin for CakePHP provides deferred task execution.

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

CakePHP IdeHelper Plugin to improve auto-completion

1882.3M43](/packages/dereuromark-cakephp-ide-helper)[friendsofcake/bootstrap-ui

Bootstrap front-end framework support for CakePHP

3522.2M41](/packages/friendsofcake-bootstrap-ui)[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

3361.0M51](/packages/dereuromark-cakephp-tools)

PHPackages © 2026

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