PHPackages                             lyxxxh/larlang - 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. lyxxxh/larlang

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

lyxxxh/larlang
==============

laravel根据 (表字段和自定义文件)生成各国语言包

012PHP

Since Jun 13Pushed 7y agoCompare

[ Source](https://github.com/lyxxg/larlang)[ Packagist](https://packagist.org/packages/lyxxxh/larlang)[ RSS](/packages/lyxxxh-larlang/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

[点击查看演示](https://gz.bcebos.com/v1/xxh-download/lang.gif)

### 安装

[](#安装)

```
 composer require lyxxxh/larlang

 添加服务提供者
 Xxh\LarTran\LarTranProvider::class  //依赖此服务做翻译
 Xxh\LarLang\LarLangProvider::class

 发布配置
 php artisan vendor:publish --provider="Xxh\LarLang\LarLangProvider"

```

### 配置说明

[](#配置说明)

字段说明默认lang要生成的语言包\['zh','en','cht'\]forget\_table忽略生成语言包的表看配置forget\_field忽略翻译的字段\['id'\]使用
--

[](#使用)

### 生成路径

[](#生成路径)

一切都生成在resource/lang

### 初始化所有表字段的语言包

[](#初始化所有表字段的语言包)

```
 php artisan lang:table:init comment  根据表注释创建语言包(没有注释就用字段)

 php artisan lang:table:init   根据表字段创建语言包
 默认使用百度翻译  翻译不是我理想的效果
 例如 id被翻译成 身份证件  所以建议根据表注释创建

```

### 根据文件夹 (绝对路径)

[](#根据文件夹-绝对路径)

```
php artisan lang:folder E:\hello\tem

```

### 根据文件 (绝对路径)

[](#根据文件-绝对路径)

```
php artisan lang:file E:\hello\tem\hello.php

```

### 扯淡

[](#扯淡)

```
依赖于Xxh\LarTran\LarTranProvider做翻译
有一个中文语言包，要中 英 繁 多语言等等
再复制语言包，翻译，复制，翻译，复制。。。。
蛋疼  用于解决这种蛋疼的情况

```

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0fbda2846ce7576ecbef245263ab795e62a1ea4a31c6d58bfdea89e20194ec90?d=identicon)[lyxxg](/maintainers/lyxxg)

---

Top Contributors

[![lyxxxh](https://avatars.githubusercontent.com/u/35553218?v=4)](https://github.com/lyxxxh "lyxxxh (2 commits)")

### Embed Badge

![Health badge](/badges/lyxxxh-larlang/health.svg)

```
[![Health](https://phpackages.com/badges/lyxxxh-larlang/health.svg)](https://phpackages.com/packages/lyxxxh-larlang)
```

###  Alternatives

[smmoosavi/php-gettext

Wrapper for php-gettext by danilo segan. This library provides PHP functions to read MO files even when gettext is not compiled in or when appropriate locale is not present on the system.

1926.6k1](/packages/smmoosavi-php-gettext)[laradevs/spanish

labels translated to spanish

166.7k](/packages/laradevs-spanish)

PHPackages © 2026

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