Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/laravel-admin-extensions/multi-language
https://github.com/laravel-admin-extensions/multi-language
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/laravel-admin-extensions/multi-language
- Owner: laravel-admin-extensions
- License: mit
- Created: 2019-07-04T05:30:47.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-10-19T14:23:10.000Z (about 2 years ago)
- Last Synced: 2024-11-02T18:41:43.354Z (about 1 month ago)
- Language: Blade
- Size: 14.6 KB
- Stars: 25
- Watchers: 2
- Forks: 19
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-laravel-admin - multi-language - 多语言切换组件 (扩展包 / 工具类扩展包)
README
laravel-admin Multi Language
======## Install
```
composer require laravel-admin-extensions/multi-language
```## Config
First, add extension config
In `config/admin.php`
```
'extensions' => [
'multi-language' => [
'enable' => true,
// the key should be same as var locale in config/app.php
// the value is used to show
'languages' => [
'en' => 'English',
'zh-CN' => '简体中文',
],
// default locale
'default' => 'zh-CN',
// if or not show multi-language login page, optional, default is true
'show-login-page' => true,
// if or not show multi-language navbar, optional, default is true
'show-navbar' => true,
// the cookie name for the multi-language var, optional, default is 'locale'
'cookie-name' => 'locale'
],
],
```Then, add except route to auth
In `config/admin.php`, add `locale` to `auth.excepts`
```
'auth' => [
...
// The URIs that should be excluded from authorization.
'excepts' => [
'auth/login',
'auth/logout',
// add this line !
'locale',
],
],```
## ScreenShots
![login](https://user-images.githubusercontent.com/20313390/60640921-ff109480-9e5b-11e9-8ec8-aee897a8bdcb.jpg)
![login1](https://user-images.githubusercontent.com/20313390/60640924-0041c180-9e5c-11e9-8a2d-539d6214d069.jpg)
![language](https://user-images.githubusercontent.com/20313390/60640919-fc15a400-9e5b-11e9-962d-175fb2f24da1.jpg)