https://github.com/vuongxuongminh/laravel-view-localization
Package support dynamic render view by user locale for Laravel application.
https://github.com/vuongxuongminh/laravel-view-localization
laravel-package localization view-localization
Last synced: 27 days ago
JSON representation
Package support dynamic render view by user locale for Laravel application.
- Host: GitHub
- URL: https://github.com/vuongxuongminh/laravel-view-localization
- Owner: vuongxuongminh
- License: mit
- Created: 2019-06-24T06:08:16.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-26T16:59:20.000Z (almost 6 years ago)
- Last Synced: 2025-04-03T12:57:15.790Z (about 1 month ago)
- Topics: laravel-package, localization, view-localization
- Language: PHP
- Homepage:
- Size: 11.7 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
Laravel View Localization
## About it
A package support you dynamic render view by user locale for Laravel application.
## Installation
Require Laravel View Localization using [Composer](https://getcomposer.org):
```bash
composer require vxm/laravel-view-localization
```You need to publish the config-file with:
```php
php artisan vendor:publish --provider="VXM\ViewLocalization\ViewLocalizationServiceProvider" --tag="config"
```This is the contents of the published config file:
```php
return [
/**
* Your source language locale.
*/
'sourceLocale' => 'en',
];
```## Usage
It is a way to replace a set of views with another by user locale without the need of touching the original view rendering code.
You can use it to systematically change the look and feel of an application depend on user locale.
For example, when call `view('about')`, you will be rendering the view file `resources/views/about.blade.php`, if user locale is `vi`, the view file `resources/views/vi/about.blade.php` will be rendered, instead.>Note: If the application locale is the same as source locale original view will be rendered regardless of presence of translated view.
The package will automatically register itself. Now your application can dynamic render view by user locale.