{"id":18345797,"url":"https://github.com/hyperf/translation","last_synced_at":"2025-04-06T08:32:07.268Z","repository":{"id":42188456,"uuid":"203755000","full_name":"hyperf/translation","owner":"hyperf","description":"A independent translation component","archived":false,"fork":false,"pushed_at":"2024-09-25T03:34:09.000Z","size":73,"stargazers_count":8,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-25T16:04:16.284Z","etag":null,"topics":["coroutine","hyperf","i18n","swoole","translation"],"latest_commit_sha":null,"homepage":"https://doc.hyperf.io/#/zh/translation","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/hyperf.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,"publiccode":null,"codemeta":null},"funding":{"open_collective":"hyperf","custom":"https://hyperf.wiki/#/zh-cn/donate"}},"created_at":"2019-08-22T08:57:05.000Z","updated_at":"2024-09-25T03:03:34.000Z","dependencies_parsed_at":"2023-02-01T05:05:12.427Z","dependency_job_id":"f88cc0e1-5c68-4a89-91e2-2ea20675a974","html_url":"https://github.com/hyperf/translation","commit_stats":null,"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperf%2Ftranslation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperf%2Ftranslation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperf%2Ftranslation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperf%2Ftranslation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperf","download_url":"https://codeload.github.com/hyperf/translation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223245061,"owners_count":17112572,"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":["coroutine","hyperf","i18n","swoole","translation"],"created_at":"2024-11-05T21:09:31.223Z","updated_at":"2024-11-05T21:09:31.741Z","avatar_url":"https://github.com/hyperf.png","language":"PHP","readme":"# Hyperf Translation\n\n[hyperf/translation](https://github.com/hyperf/translation) 组件衍生于 `Laravel Translation` 组件的，我们对它进行了一些改造，大部分功能保持了相同。在这里感谢一下 Laravel 开发组，实现了如此强大好用的 Translation 组件。\n\n## Installation\n\n```bash\ncomposer require hyperf/translation\n```\n\n## Configuration\n\n### Publish config\n\n```bash\nphp bin/hyperf.php vendor:publish hyperf/translation\n```\n\nConfig files:\n```\n+ ./config/autoload/translation.php\n```\n\n### Configuration\n\n```php\n\u003c?php\ndeclare(strict_types=1);\n\nreturn [\n    'locale' =\u003e 'en',   \n    'fallback_locale' =\u003e '',\n    'path' =\u003e BASE_PATH . '/storage/languages', \n];\n```\n\n## Usage\n\n```php\n$container = ApplicationContext::getContainer();\n$translator = $container-\u003eget(\\Hyperf\\Contract\\TranslatorInterface::class);\n$translator-\u003etrans('validation.accepted');\n```","funding_links":["https://opencollective.com/hyperf","https://hyperf.wiki/#/zh-cn/donate"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperf%2Ftranslation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperf%2Ftranslation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperf%2Ftranslation/lists"}