{"id":28955817,"url":"https://github.com/kodedphp/i18n","last_synced_at":"2025-07-15T07:14:56.468Z","repository":{"id":57007928,"uuid":"450590609","full_name":"kodedphp/i18n","owner":"kodedphp","description":"Internationalization library","archived":false,"fork":false,"pushed_at":"2024-02-22T23:14:18.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-03-23T10:01:05.281Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kodedphp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2022-01-21T17:59:10.000Z","updated_at":"2022-01-24T11:32:19.000Z","dependencies_parsed_at":"2022-08-21T14:31:27.955Z","dependency_job_id":"71eb47dd-cd0b-47c1-be84-4191127323ad","html_url":"https://github.com/kodedphp/i18n","commit_stats":{"total_commits":41,"total_committers":2,"mean_commits":20.5,"dds":0.04878048780487809,"last_synced_commit":"c1a73591548cdfd5a7527a012e446981db22aebf"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/kodedphp/i18n","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedphp%2Fi18n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedphp%2Fi18n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedphp%2Fi18n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedphp%2Fi18n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kodedphp","download_url":"https://codeload.github.com/kodedphp/i18n/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedphp%2Fi18n/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261548741,"owners_count":23175499,"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":"2025-06-23T20:10:09.744Z","updated_at":"2025-06-23T20:10:10.892Z","avatar_url":"https://github.com/kodedphp.png","language":"PHP","readme":"Koded - i18n\n============\n\n[![CI](https://github.com/kodedphp/i18n/actions/workflows/ci.yaml/badge.svg)](https://github.com/kodedphp/i18n/actions/workflows/ci.yaml)\n[![Latest Stable Version](https://img.shields.io/packagist/v/koded/i18n.svg)](https://packagist.org/packages/koded/i18n)\n[![Minimum PHP Version: 8.1](https://img.shields.io/badge/php-%3E%3D%208.1-8892BF.svg)](https://php.net/)\n\nA simple internationalization library with support for .po and .php translation files.\n\n    composer require koded/i18n\n\nRequirements\n------------\n\n- intl\n- gettext\n\nUsage\n-----\n\n```php\n__(string $message, array $arguments =\u003e [], string $locale = '');\n```\n\nConfiguration\n-------------\n\nThe `I18n` class is static and should be configured \nsomewhere in the beginning of your PHP code/script.\n\n```php\nuse Koded\\Stdlib\\Config;\nuse Koded\\I18n\\{ArrayCatalog, DefaultFormatter, I18n, I18nCatalog};\n\n// all conf directives are optional\n$config = new Config([\n    'translation.catalog' =\u003e ArrayCatalog::class,\n    'translation.formatter' =\u003e DefaultFormatter::class,\n    'translation.dir' =\u003e '/path/to/your/translation/files',\n    'translation.locale' =\u003e ['mk_MK', 'de_DE', 'it_IT'],\n]);\n\nI18n::register(I18nCatalog::new($config));\n```\n\n\nTranslation files\n-----------------\n\n### .po files\n\n`poedit` is a very good app to work with your translation files.\n\n### .php files\n\nThe translation file has a simple structure\n\n```php\nreturn [\n    'language' =\u003e '',\n    'messages' =\u003e [\n        // your translation strings goes here\n        'original string' =\u003e 'translated string',\n    ]\n];\n```\n\nwhere `messages` contains `key =\u003e value` pairs for the translated strings.\n\nCode quality\n------------\n\n[![Code Coverage](https://scrutinizer-ci.com/g/kodedphp/i18n/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/kodedphp/i18n/?branch=master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/kodedphp/i18n/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/kodedphp/i18n/?branch=master)\n\n```shell script\nvendor/bin/phpunit\n```\n\nLicense\n-------\n\n[![Software license](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](LICENSE)\n\nThe code is distributed under the terms of [The 3-Clause BSD license](LICENSE).\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkodedphp%2Fi18n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkodedphp%2Fi18n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkodedphp%2Fi18n/lists"}