{"id":37015879,"url":"https://github.com/chubbyphp-legacy/chubbyphp-translation","last_synced_at":"2026-01-14T01:36:50.804Z","repository":{"id":56952687,"uuid":"69793218","full_name":"chubbyphp-legacy/chubbyphp-translation","owner":"chubbyphp-legacy","description":"A simple translation solution.","archived":true,"fork":false,"pushed_at":"2018-12-07T06:37:45.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-27T14:48:59.595Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chubbyphp-legacy.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}},"created_at":"2016-10-02T11:16:30.000Z","updated_at":"2023-01-28T18:21:57.000Z","dependencies_parsed_at":"2022-08-21T04:10:14.453Z","dependency_job_id":null,"html_url":"https://github.com/chubbyphp-legacy/chubbyphp-translation","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/chubbyphp-legacy/chubbyphp-translation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp-legacy%2Fchubbyphp-translation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp-legacy%2Fchubbyphp-translation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp-legacy%2Fchubbyphp-translation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp-legacy%2Fchubbyphp-translation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chubbyphp-legacy","download_url":"https://codeload.github.com/chubbyphp-legacy/chubbyphp-translation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp-legacy%2Fchubbyphp-translation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-14T01:36:48.250Z","updated_at":"2026-01-14T01:36:50.797Z","avatar_url":"https://github.com/chubbyphp-legacy.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chubbyphp-translation\n\n[![Build Status](https://api.travis-ci.org/chubbyphp/chubbyphp-translation.png?branch=master)](https://travis-ci.org/chubbyphp/chubbyphp-translation)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/chubbyphp/chubbyphp-translation/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/chubbyphp/chubbyphp-translation/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/chubbyphp/chubbyphp-translation/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/chubbyphp/chubbyphp-translation/?branch=master)\n[![Total Downloads](https://poser.pugx.org/chubbyphp/chubbyphp-translation/downloads.png)](https://packagist.org/packages/chubbyphp/chubbyphp-translation)\n[![Monthly Downloads](https://poser.pugx.org/chubbyphp/chubbyphp-translation/d/monthly)](https://packagist.org/packages/chubbyphp/chubbyphp-translation)\n[![Latest Stable Version](https://poser.pugx.org/chubbyphp/chubbyphp-translation/v/stable.png)](https://packagist.org/packages/chubbyphp/chubbyphp-translation)\n[![Latest Unstable Version](https://poser.pugx.org/chubbyphp/chubbyphp-translation/v/unstable)](https://packagist.org/packages/chubbyphp/chubbyphp-translation)\n\n## Description\n\nA simple translation solution.\n\n## Requirements\n\n * php: ~7.0\n\n## Suggest\n\n * pimple/pimple: ~3.0\n * twig/twig: ^1.25.0\n\n## Installation\n\nThrough [Composer](http://getcomposer.org) as [chubbyphp/chubbyphp-translation][1].\n\n```sh\ncomposer require chubbyphp/chubbyphp-translation \"~1.1\"\n```\n\n## Usage\n\n### Translator\n\n```php\n\u003c?php\n\nuse Chubbyphp\\Translation\\LocaleTranslationProvider;\nuse Chubbyphp\\Translation\\Translator;\n\n$translator = new Translator([\n    new LocaleTranslationProvider('de', [\n        'some.existing.key' =\u003e 'erfolgreiche Uebersetzung',\n        'another.existing.key' =\u003e '%d erfolgreiche Uebersetzungen',\n        'yetanother.existing.key' =\u003e '{{key}} erfolgreiche Uebersetzungen'\n    ]),\n    new LocaleTranslationProvider('en', [\n        'some.existing.key' =\u003e 'successful translation',\n        'another.existing.key' =\u003e '%d successful translations'\n        'yetanother.existing.key' =\u003e '{{key}} successful translations'\n    ])\n]);\n\necho $translator-\u003etranslate('de', 'some.existing.key'); // erfolgreiche Uebersetzung\necho $translator-\u003etranslate('en', 'some.existing.key'); // successful translation\necho $translator-\u003etranslate('fr', 'some.existing.key'); // some.existing.key\n\necho $translator-\u003etranslate('de', 'another.existing.key', [5]); // 5 erfolgreiche Uebersetzungen\necho $translator-\u003etranslate('en', 'another.existing.key', [5]); // 5 successful translations\necho $translator-\u003etranslate('fr', 'another.existing.key', [5]); // some.existing.key\n\necho $translator-\u003etranslate('de', 'yetanother.existing.key', ['key' =\u003e 5]); // 5 erfolgreiche Uebersetzungen\necho $translator-\u003etranslate('en', 'yetanother.existing.key', ['key' =\u003e 5]); // 5 successful translations\necho $translator-\u003etranslate('fr', 'yetanother.existing.key', ['key' =\u003e 5]); // some.existing.key\n```\n\n### TranslationProvider (Pimple)\n\n```php\n\u003c?php\n\nuse Chubbyphp\\Translation\\Translator;\nuse Chubbyphp\\Translation\\TranslationProvider;\nuse Pimple\\Container;\n\n$container-\u003eregister(new TranslationProvider);\n\n$container-\u003eextend('translator.providers', function (array $providers) use ($container) {\n    $providers[] = new LocaleTranslationProvider('de', [\n        'some.existing.key' =\u003e 'erfolgreiche Uebersetzung',\n        'another.existing.key' =\u003e '%d erfolgreiche Uebersetzungen'\n    ]);\n    $providers[] = new LocaleTranslationProvider('en', [\n        'some.existing.key' =\u003e 'successful translation',\n        'another.existing.key' =\u003e '%d successful translations'\n    ]);\n\n    return $providers;\n});\n\n/** @var Translation $translator */\n$translator = $container['translator'];\n```\n\n### TranslationTwigExtension\n\n```php\n\u003c?php\n\nuse Chubbyphp\\Translation\\LocaleTranslationProvider;\nuse Chubbyphp\\Translation\\TranslationTwigExtension;\nuse Chubbyphp\\Translation\\Translator;\n\n$twig-\u003eaddExtension(new TranslationTwigExtension(new Translator([])));\n```\n\n```twig\n{{ 'some.existing.key'|translate('de') }}\n{{ 'another.existing.key'|translate('de', [5]) }}\n{{ 'yetanother.existing.key'|translate('de', ['key' =\u003e 5]) }}\n```\n\n[1]: https://packagist.org/packages/chubbyphp/chubbyphp-translation\n\n## Copyright\n\nDominik Zogg 2016\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchubbyphp-legacy%2Fchubbyphp-translation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchubbyphp-legacy%2Fchubbyphp-translation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchubbyphp-legacy%2Fchubbyphp-translation/lists"}