{"id":13684259,"url":"https://github.com/cakephp/localized","last_synced_at":"2025-06-25T23:07:20.995Z","repository":{"id":739987,"uuid":"390669","full_name":"cakephp/localized","owner":"cakephp","description":"I18n and L10n related CakePHP code","archived":false,"fork":false,"pushed_at":"2025-04-19T22:32:45.000Z","size":1112,"stargazers_count":212,"open_issues_count":3,"forks_count":175,"subscribers_count":38,"default_branch":"5.x","last_synced_at":"2025-04-30T20:33:43.497Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cakephp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2009-11-30T20:19:49.000Z","updated_at":"2025-04-23T16:37:33.000Z","dependencies_parsed_at":"2023-11-12T14:28:24.039Z","dependency_job_id":"191dc1d5-1a26-46f5-8533-d135b8f11676","html_url":"https://github.com/cakephp/localized","commit_stats":{"total_commits":490,"total_committers":111,"mean_commits":4.414414414414415,"dds":0.889795918367347,"last_synced_commit":"22033cda5c62e5be99d5299b2da92f12b3bb58a5"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/cakephp/localized","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Flocalized","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Flocalized/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Flocalized/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Flocalized/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cakephp","download_url":"https://codeload.github.com/cakephp/localized/tar.gz/refs/heads/5.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cakephp%2Flocalized/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261967132,"owners_count":23237663,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T14:00:31.603Z","updated_at":"2025-06-25T23:07:20.967Z","avatar_url":"https://github.com/cakephp.png","language":"PHP","readme":"# CakePHP Localized plugin\n\n![Build Status](https://github.com/cakephp/localized/actions/workflows/ci.yml/badge.svg)\n[![Coverage Status](https://img.shields.io/codecov/c/github/cakephp/localized/5.x.svg?style=flat-square)](https://app.codecov.io/gh/cakephp/localized/tree/5.x)\n[![Latest Stable Version](https://img.shields.io/github/v/release/cakephp/localized?sort=semver\u0026style=flat-square)](https://packagist.org/packages/cakephp/localized)\n[![Total Downloads](https://img.shields.io/packagist/dt/cakephp/localized?style=flat-square)](https://packagist.org/packages/cakephp/localized/stats)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)\n\nThis plugin contains various localized validation classes for specific countries.\n\n## Requirements\n\nThis branch is for use with CakePHP **5.x**. See [version map](https://github.com/cakephp/localized/wiki#version-map) for details.\n\n## Demo\nSee [sandbox.dereuromark.de/sandbox/localized](https://sandbox.dereuromark.de/sandbox/localized) for live sandbox demo on localized validation.\n\n## Installation\n\nYou can install this plugin into your CakePHP application using [composer](https://getcomposer.org).\n\nThe recommended way to install composer packages is:\n\n```\ncomposer require cakephp/localized\n```\n\nLoad your plugin using\n```\nbin/cake plugin load Cake/Localized\n```\nor by manually adding `'Cake/Localized'` to the array in your app's `config/plugins.php`.\n\n## Model validation\n\nLocalized validation classes can be used for validating model fields.\n\n```php\nnamespace App\\Model\\Table;\n\nuse Cake\\ORM\\Table;\nuse Cake\\Localized\\Validation\\FrValidation;\nuse Cake\\Validation\\Validator;\n\nclass PostsTable extends Table\n{\n    public function validationDefault(Validator $validator): Validator\n    {\n        $validator-\u003esetProvider('fr', FrValidation::class);\n        $validator-\u003eadd('phoneField', 'myCustomRuleNameForPhone', [\n            'rule' =\u003e 'phone',\n            'provider' =\u003e 'fr',\n        ]);\n    }\n}\n```\n\nFor further information on validation rules see the [CakePHP documentation on validation](https://book.cakephp.org/5/en/core-libraries/validation.html)\n\n## PO files\n\nThis plugin also houses translations for the client-facing translated strings in the core (the `cake` domain). to use these files link or copy them\ninto their expected location: `resources/locales/\u003clocale\u003e/cake.po`\n\n## Contributing to Localized\n\nIf you find that your country is not part of the Localized plugin, please fork the project on GitHub.\nOnce you have forked the project you can commit your validator class (and any test cases).\nAs 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.\n\n### Validation methods\n\nThere are a few methods that are common to all classes, defined through the interface \"ValidationInterface\":\n\n* `phone()` to check a phone number\n* `postal()` to check a postal code\n* `personId()` to check a country specific person ID\n\nPlease try to fit your validation rules in that naming scheme.\nApart from that you can also define further validation methods in your implementing class, of course.\n\n## Issues with Localized\n\nIf you have issues with Localized, you can report them at [github.com/cakephp/localized/issues](https://github.com/cakephp/localized/issues).\n","funding_links":[],"categories":["I18n"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcakephp%2Flocalized","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcakephp%2Flocalized","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcakephp%2Flocalized/lists"}