hyperf/translation
An independent translation component, forked by illuminate/translation.
2,476,842
7
Larablocks Analysis
hyperf/translation works with any PHP project: the latest release (v3.2.0, Jun 7, 2026) doesn't depend on Laravel.
Recommendation checks
Solid choiceSolid choice: maintained and up to date, meets 2 of 3 checks; below the bar for Recommended on use.
- Released in the last 12 months (Jun 7, 2026)
- 54,316 downloads a month (at least 10,000)
- 7 GitHub stars (needs 100)
State
Maintained- Last stable release: Jun 7, 2026.
- 1 release in the last 12 months.
- First released: Aug 27, 2019.
- Monthly downloads: 54,316, up 26% from six months ago.
- 2 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.
| Install | |
|---|---|
composer require hyperf/translation |
|
| Latest Version: | v3.2.0 |
| PHP: | >=8.2 |
| License: | MIT |
| Last Updated: | Jun 7, 2026 |
| Links: | GitHub · Packagist |
Maintainer: hyperf
Hyperf Translation
hyperf/translation 组件衍生于 Laravel Translation 组件的,我们对它进行了一些改造,大部分功能保持了相同。在这里感谢一下 Laravel 开发组,实现了如此强大好用的 Translation 组件。
Installation
composer require hyperf/translation
Configuration
Publish config
php bin/hyperf.php vendor:publish hyperf/translation
Config files:
+ ./config/autoload/translation.php
Configuration
<?php
declare(strict_types=1);
return [
'locale' => 'en',
'fallback_locale' => '',
'path' => BASE_PATH . '/storage/languages',
];
Usage
$container = ApplicationContext::getContainer();
$translator = $container->get(\Hyperf\Contract\TranslatorInterface::class);
$translator->trans('validation.accepted');
Related Packages
hyperf/scout
Hyperf Scout provides a driver based solution to searching your Eloquent models....
195,433
6
Version History
| Version | Released | PHP | License |
|---|---|---|---|
| v3.2.0 | >=8.2 | MIT | |
| v3.1.63 | >=8.1 | MIT | |
| v3.1.57 | >=8.1 | MIT | |
| v3.1.42 | >=8.1 | MIT | |
| v3.1.35 | >=8.1 | MIT | |
| v3.1.33 | >=8.1 | MIT | |
| v3.1.27 | >=8.1 | MIT | |
| v3.1.15 | >=8.1 | MIT | |
| v3.1.0 | >=8.1 | MIT | |
| v3.0.42 | >=8.0 | MIT | |
| v3.0.37 | >=8.0 | MIT | |
| v3.0.22 | >=8.0 | MIT | |
| v3.0.18 | >=8.0 | MIT | |
| v3.0.17 | >=8.0 | MIT | |
| v3.0.16 | >=8.0 | MIT | |
| v3.0.15 | >=8.0 | MIT | |
| v3.0.0 | >=8.0 | MIT | |
| v2.2.33 | >=7.2 | MIT | |
| v2.2.13 | >=7.2 | MIT | |
| v2.2.5 | >=7.2 | MIT | |
| v2.2.0 | >=7.2 | MIT | |
| v2.1.0 | >=7.2 | MIT | |
| v2.0.18 | >=7.2 | MIT | |
| v2.0.13 | >=7.2 | MIT | |
| v2.0.3 | >=7.2 | MIT | |
| v2.0.0 | >=7.2 | MIT | |
| v1.1.26 | >=7.2 | MIT | |
| v1.1.17 | >=7.2 | MIT | |
| v1.1.16 | >=7.2 | MIT | |
| v1.1.6 | >=7.2 | MIT |
Showing the latest 30 of 34. See every release on Packagist
Pre-releases (13)
| Version | Released | PHP | License |
|---|---|---|---|
| v3.2.0-alpha.3 | >=8.2 | MIT | |
| v3.2.0-alpha.1 | >=8.2 | MIT | |
| v3.1.0-rc.11 | >=8.1 | MIT | |
| v3.1.0-rc.4 | >=8.1 | MIT | |
| v3.1.0-alpha.1 | >=8.1 | MIT | |
| v3.0.0-rc.13 | >=8.0 | MIT | |
| v3.0.0-rc.3 | >=8.0 | MIT | |
| v3.0.0-rc.1 | >=8.0 | MIT | |
| v3.0.0-beta.1 | >=8.0 | MIT | |
| v3.0.0-alpha.4 | >=8.0 | MIT | |
| v3.0.0-alpha.1 | >=8.0 | MIT | |
| v2.2.0-beta1 | >=7.2 | MIT | |
| v2.1.0-beta1 | >=7.2 | MIT |