定制 chinleung/laravel-locales 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

chinleung/laravel-locales

最新稳定版本:v2.2.2

Composer 安装命令:

composer require chinleung/laravel-locales

包简介

Add configurations and helpers for a multi locale application.

README 文档

README

Latest Version on Packagist Build Status Quality Score Total Downloads

Add configurations and helpers to make an application support multiple locales.

Installation

You can install the package via composer:

composer require chinleung/laravel-locales

Configuration

By default, the application locales is only going to be en. If your application support other locales, you can either set a app.locales in your config/app.php or publish the configuration file:

php artisan vendor:publish --provider="ChinLeung\LaravelLocales\LaravelLocalesServiceProvider" --tag="config"

Helpers

locale(string $locale = null) : string

Retrieve or update the current locale of the application.

// Alias of app()->getLocale();
locale(); // 'en'

// Alias of app()->setLocale('fr');
locale('fr'); // 'fr'
locale(); // 'fr'

locales(array $locales = null) : array

Retrieve or update the supported locales of the application.
Has priority for app.locales over laravel-locales.supported.

locales(); // ['en']

locales(['en', 'fr', 'zh']);
locales(); // ['en', 'fr', 'zh']

locales(['en', 'zh']);
locales(); // ['en', 'zh']

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email hello@chinleung.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.

统计信息

  • 总下载量: 188.31k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 35
  • 点击次数: 1
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 35
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-07-30