PHPackages                             xianbaihong/laravel-lang - 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. xianbaihong/laravel-lang

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

xianbaihong/laravel-lang
========================

List of 75 languages for Laravel.

00[1 PRs](https://github.com/xianbaihong/laravel-lang/pulls)PHP

Since Apr 13Pushed 2y ago1 watchersCompare

[ Source](https://github.com/xianbaihong/laravel-lang)[ Packagist](https://packagist.org/packages/xianbaihong/laravel-lang)[ RSS](/packages/xianbaihong-laravel-lang/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Laravel-lang
============

[](#laravel-lang)

基于 [Laravel-Lang/lang](https://github.com/Laravel-Lang/lang) 的Laravel应用程序支持75种语言。

[![For Laravel 5](https://camo.githubusercontent.com/082f1fd289cf55b7838ac420fe4654e37df7b67c877b28cb5043b273e066e7ca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d72656164792d677265656e2e737667)](https://github.com/xianbaihong/laravel-lang)[![For Lumen 5](https://camo.githubusercontent.com/fee21411e4cc738781b8c5fd5f5447d72b0dbff20d2c6d1049177879b29aa511/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c756d656e2d72656164792d677265656e2e737667)](https://github.com/xianbaihong/laravel-lang)[![Latest Stable Version](https://camo.githubusercontent.com/3b8a9b24a3540a7614a220e7255069df112c22d7e19305dea6fd82f788e6815b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7869616e626169686f6e672f6c61726176656c2d6c616e672e737667)](https://packagist.org/packages/xianbaihong/laravel-lang)[![Latest Unstable Version](https://camo.githubusercontent.com/b7eacd968fadba8ba86e7c1367c816b5b3f1389b6a543a5a573bc5d1ca99d004/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f7869616e626169686f6e672f6c61726176656c2d6c616e672e737667)](https://packagist.org/packages/xianbaihong/laravel-lang)[![Total Downloads](https://camo.githubusercontent.com/b452dcbc4b6404f899e888ef851d21b18e64987dfff9ac082542f771ed9aed16/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7869616e626169686f6e672f6c61726176656c2d6c616e672e7376673f6d61784167653d32353932303030)](https://packagist.org/packages/xianbaihong/laravel-lang)[![License](https://camo.githubusercontent.com/5f57333742146e627c520c431e19b01f88d89e72e0ea72cd8a81bfa97d15e5f9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7869616e626169686f6e672f6c61726176656c2d6c616e672e7376673f6d61784167653d32353932303030)](https://packagist.org/packages/xianbaihong/laravel-lang)

Install
=======

[](#install)

Laravel versionComposer commandLaravel 9.x`composer require xianbaihong/laravel-lang:~6.0`Laravel 7.x-8.x`composer require xianbaihong/laravel-lang:~5.0`Laravel 6.x`composer require xianbaihong/laravel-lang:~4.0`Laravel 5.8`composer require xianbaihong/laravel-lang:~3.0`Laravel 5.1-5.7`composer require xianbaihong/laravel-lang:~2.0`Laravel 5`composer require xianbaihong/laravel-lang:~1.0````
composer require "xianbaihong/laravel-lang:~6.0"
```

#### Lumen

[](#lumen)

Add the following line to `bootstrap/app.php`:

```
$app->register(Xianbaihong\LaravelLang\TranslationServiceProvider::class);
```

Configuration
=============

[](#configuration)

### Laravel

[](#laravel)

you can change the locale at `config/app.php`:

```
'locale' => 'zh_CN',
```

### Lumen

[](#lumen-1)

set locale in `.env` file:

```
APP_LOCALE=zh_CN

```

Usage
=====

[](#usage)

There is no difference with the usual usage.

If you need to add additional language content, Please create a file in the `resources/lang/{LANGUAGE}` directory.

### Add custom language items

[](#add-custom-language-items)

Here, for example in Chinese:

`resources/lang/zh_CN/demo.php`:

```
