An open API service indexing awesome lists of open source software.

https://github.com/askdkc/laravel-language-switcher

This is a demonstration of a Laravel application showcasing the seamless process of changing language locales.
https://github.com/askdkc/laravel-language-switcher

Last synced: 5 months ago
JSON representation

This is a demonstration of a Laravel application showcasing the seamless process of changing language locales.

Awesome Lists containing this project

README

          

# Language Switcher Sample (言語切り替えサンプル)

This is language switcher Laravel app sample. Laravelの言語切り替えサンプルです🇺🇸🇯🇵

![langswitch](https://github.com/askdkc/laravel-language-switcher/assets/7894265/d807d110-971e-44c0-a284-9e1b57c73894)

## Installation

```bash
git clone this_repository
cd this_repository
composer install
cp .env.example .env
php artisan key:generate
php artisan migrate

npm install && npm run build

php artisan serve
```

Open [`http://localhost:8000`](http://localhost:8000) in your browser. (ブラウザでURL開いてね)

## Implementation

- Japanese Language files: `lang/ja.json`, `lang/ja/[auth|pagination|passwords|validation].php` (言語ファイル)
- Language Switch Middleware: `app/Http/Middleware/Localization.php` (言語切替ミドルウェア)
- Kernel (Register Language Switch Middleware): `app/Http/Kernel.php` (カーネル:言語切替ミドルウェア登録)
- Route (Language Switcher Route): `routes/web.php` (ルーティング 言語切替ルート)

## Screen Shot

- English (英語)

English Screen

- Japanese (日本語)

Japanese Screen