GithubHelp home page GithubHelp logo

junfengwu / laravel-lang Goto Github PK

View Code? Open in Web Editor NEW

This project forked from overtrue/laravel-lang

0.0 2.0 0.0 70 KB

37 languages for Laravel 5 based on Laravel4-lang.

License: MIT License

PHP 100.00%

laravel-lang's Introduction

Laravel-lang

37 languages for Laravel 5 based on Laravel4-lang.

中文说明

Latest Stable Version Total Downloads Latest Unstable Version License

Install

composer require "overtrue/laravel-lang:dev-master"

or add the following line to your project's composer.json:

"require": {
    "overtrue/laravel-lang": "dev-master"
}

then

composer update

After completion of the above, Replace the config/app.php content

'Illuminate\Translation\TranslationServiceProvider'

into

'Overtrue\LaravelLang\TranslationServiceProvider',

Configuration

Modify the project language:

config/app.php:

'locale' => 'zh-CN',

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

Here, for example in Chinese:

resources/lang/zh-CN/demo.php:

<?php

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

Used in the template:

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

Replace the default language items partially

We assume that want to replace the password.reset message:

resources/lang/zh-CN/passwords.php:

<?php

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

You need only add the part what you want.

License

MIT

laravel-lang's People

Contributors

overtrue avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.