mlatjac/fren
Composer 安装命令:
composer require mlatjac/fren
包简介
Setup bilingual (French and English) Laravel projects easily.
README 文档
README
Laravel package that supplies language tracking and language switching services and pulls in commonly used multi-language packages to create a sane basis for bilingual (French and English) Laravel apps.
Take a look at contributing.md to see a to do list.
Installation
Via Composer
$ composer require mlatjac/fren
Usage
Language middleware
The Language middleware sets the app's current locale to the currently selected language.
The package inserts this middleware in the middleware stack for all web routes.
To specifically invoke this middleware on a route, you can use its 'lang' alias, as in:
Route::get('/', function () { return view('welcome'); })->middleware('lang');
Language switching routes
This package registers language switching routes. These routes update the currently selected language and redirect back to the calling url.
The url '/lang/en' will switch the current language to English, the '/lang/fr' will switch the current language to French.
Use its route name 'lang.switch' along with its languageCode parameter with url builders, as in:
url(route('lang.switch',['languageCode' => 'en']))
Change log
Please see the changelog for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email author email instead of using the issue tracker.
Credits
License
license. Please see the license file for more information.
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-11-18