2017 © Pedro Peláez
 

library laravel-lang

List of 52 languages for Laravel 5

image

overtrue/laravel-lang

List of 52 languages for Laravel 5

  • Tuesday, May 1, 2018
  • by overtrue
  • Repository
  • 19 Watchers
  • 655 Stars
  • 102,858 Installations
  • PHP
  • 8 Dependents
  • 2 Suggesters
  • 86 Forks
  • 0 Open issues
  • 17 Versions
  • 18 % Grown

The README.md

Laravel-lang

<, (*1)

p align="center">75 languages support for Laravel application based on Laravel-Lang/lang., (*2)

For Laravel 5 For Lumen 5 Latest Stable Version Latest Unstable Version Total Downloads License, (*3)

Warning, (*4)

There is already a better solution to use our official Laravel-Lang publisher. This project will be discontinued, thank you for your support., (*5)

Features

  • Laravel 5+ && Lumen support.
  • Translations Publisher.
  • Made with 💖.

Install

Laravel version Composer command
Laravel 9.x composer require overtrue/laravel-lang:~6.0
Laravel 7.x-8.x composer require overtrue/laravel-lang:~5.0
Laravel 6.x composer require overtrue/laravel-lang:~4.0
Laravel 5.8 composer require overtrue/laravel-lang:~3.0
Laravel 5.1-5.7 composer require overtrue/laravel-lang:~2.0
Laravel 5 composer require overtrue/laravel-lang:~1.0
composer require "overtrue/laravel-lang:~6.0"

Lumen

Add the following line to bootstrap/app.php:, (*6)

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

Configuration

Laravel

you can change the locale at config/app.php:, (*7)

'locale' => 'zh_CN',

Lumen

set locale in .env file:, (*8)

APP_LOCALE=zh_CN

Usage

There is no difference with the usual usage., (*9)

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

Add custom language items

Here, for example in Chinese:, (*11)

resources/lang/zh_CN/demo.php:, (*12)

<?php

return [
    'user_not_exists'    => '用户不存在',
    'email_has_registed' => '邮箱 :email 已经注册过!',
];

Used in the template:, (*13)

echo trans('demo.user_not_exists'); // 用户不存在
echo trans('demo.email_has_registed', ['email' => 'anzhengchao@gmail.com']);
// 邮箱 anzhengchao@gmail.com 已经注册过!

Replace the default language items partially

We assume that want to replace the password.reset message:, (*14)

resources/lang/zh_CN/passwords.php:, (*15)

<?php

return [
    'reset' => '您的密码已经重置成功了,你可以使用新的密码登录了!',
];

You need only add the partials item what you want., (*16)

publish the language files to your project resources/lang/ directory

php artisan lang:publish [LOCALES] {--force}

examples:, (*17)

php artisan lang:publish zh_CN,zh_HK,th,tk

:heart: Sponsor me

Sponsor me, (*18)

如果你喜欢我的项目并想支持它,点击这里 :heart:, (*19)

Project supported by JetBrains

Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects., (*20)

, (*21)

PHP 扩展包开发

想知道如何从零开始构建 PHP 扩展包?, (*22)

请关注我的实战课程,我会在此课程中分享一些扩展开发经验 —— 《PHP 扩展包实战教程 - 从入门到发布》, (*23)

License

MIT, (*24)

The Versions

01/05 2018

dev-master

9999999-dev

List of 52 languages for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

laravel languages overtrue

01/05 2018

dev-analysis-q1AP23

dev-analysis-q1AP23

List of 52 languages for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

laravel languages overtrue

28/10 2017

3.0.8

3.0.8.0

List of 52 languages for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

laravel languages overtrue

28/10 2017

3.0.7

3.0.7.0

List of 52 languages for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

laravel languages overtrue

25/09 2017

dev-analysis-866vDN

dev-analysis-866vDN

List of 52 languages for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

laravel languages overtrue

31/07 2017

3.0.5

3.0.5.0

List of 52 languages for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

laravel languages overtrue

31/07 2017

3.0.6

3.0.6.0

List of 52 languages for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

laravel languages overtrue

10/05 2017

3.0.4

3.0.4.0

List of 52 languages for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

laravel languages overtrue

14/02 2017

3.0.3

3.0.3.0

List of 52 languages for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

laravel languages overtrue

30/05 2016

3.0.2

3.0.2.0

List of 52 languages for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

laravel languages overtrue

05/05 2016

3.0.1

3.0.1.0

List of 52 languages for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

laravel languages overtrue

05/05 2016

dev-develop

dev-develop

List of 52 languages for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

laravel languages overtrue

05/05 2016

dev-hotfix/base_path

dev-hotfix/base_path

List of 52 languages for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

laravel languages overtrue

29/04 2016

3.0.0

3.0.0.0

List of 52 languages for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

laravel languages overtrue

24/04 2016

2.0.0

2.0.0.0

List of 52 languages for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

laravel languages overtrue

19/04 2015

1.0.1

1.0.1.0

List of 37 languages for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar overtrue

laravel languages overtrue

15/03 2015

1.0.0

1.0.0.0

List of 37 languages for Laravel 5

  Sources   Download

MIT

The Requires

 

by Avatar overtrue