PHPackages                             maplesnow/laravel-yaml-translation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. maplesnow/laravel-yaml-translation

ActiveLibrary[Localization &amp; i18n](/categories/localization)

maplesnow/laravel-yaml-translation
==================================

Provide YAML file support to Laravel language translation

v1.0.6(3y ago)03671MITPHPPHP &gt;=7.0.0CI failing

Since Apr 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/summerway/laravel-yaml-translation)[ Packagist](https://packagist.org/packages/maplesnow/laravel-yaml-translation)[ RSS](/packages/maplesnow-laravel-yaml-translation/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (5)Versions (9)Used By (1)

> 提供yaml文件统一管理laravel语言包，兼容laravel的validation翻译。

安装
--

[](#安装)

```
composer require maplesnow/laravel-yaml-translation
```

添加laravel支持
-----------

[](#添加laravel支持)

将 **app/config/app.php** 中 `Illuminate\Translation\TranslationServiceProvider` 替换成 `MapleSnow\Yaml\TranslationServiceProvider`

发布yml文件到项目中:
------------

[](#发布yml文件到项目中)

```
php artisan vendor:publish --provider="MapleSnow\Yaml\TranslationServiceProvider"

```

Validation
----------

[](#validation)

将`request`文件继承`MapleSnow\Yaml\Request\BaseRequest.php`

如果需要翻译指定模块的属性

```
# 添加自定义属性
attribute:
  module:
    name: '模块名称'
```

在`Request`文件中`rules`指定模块

```
class ModuleRequest extends BaseRequest {

    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize() {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules() {
        # 指定模块
        $this->setModule("module");
        return [
            'name' => 'required'
        ];
    }
}
```

用法示例
----

[](#用法示例)

```
dump(trans("lang.message.hello",['name','laravel-yaml']));
```

License
-------

[](#license)

laravel-yaml-translation is free software distributed under the terms of the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~199 days

Recently: every ~247 days

Total

7

Last Release

1391d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e3058701be7b10c7b12972629160b82b9f4dcae7c0b95ed09e7d695fb542552a?d=identicon)[mapleSnow](/maintainers/mapleSnow)

---

Top Contributors

[![summerway](https://avatars.githubusercontent.com/u/5858441?v=4)](https://github.com/summerway "summerway (7 commits)")

### Embed Badge

![Health badge](/badges/maplesnow-laravel-yaml-translation/health.svg)

```
[![Health](https://phpackages.com/badges/maplesnow-laravel-yaml-translation/health.svg)](https://phpackages.com/packages/maplesnow-laravel-yaml-translation)
```

###  Alternatives

[barryvdh/laravel-translation-manager

Manage Laravel Translations

1.7k3.6M17](/packages/barryvdh-laravel-translation-manager)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[kkomelin/laravel-translatable-string-exporter

Translatable String Exporter for Laravel

3291.4M10](/packages/kkomelin-laravel-translatable-string-exporter)[laravel-lang/json-fallback

Adds support for fallback JSON string translation

162.2M4](/packages/laravel-lang-json-fallback)[kerigard/laravel-lang-ru

Ru lang for Laravel

2116.8k](/packages/kerigard-laravel-lang-ru)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
