kevindierkx / view-localization
Localising views in Laravel
Requires
- php: >=5.6.0
- illuminate/support: ~5.0
Requires (Dev)
- illuminate/filesystem: ~5.0
- illuminate/view: ~5.0
This package is auto-updated.
Last update: 2022-02-01 12:42:33 UTC
README
mcamara/laravel-localization now supports using the view base path for your localization making this packages obsolete.
Laravel View Localization
This package makes it possible to serve specific views for various locales.
Installation
This package is build for Laravel framework based applications.
For Laravel 4.2+ please refer to version 1.0.
Laravel 5.x
Require this package with composer:
composer require kevindierkx/view-localization
Service provider
Open config/app.php
and register the required service provider.
'providers' => [ ... 'Kevindierkx\ViewLocalization\ViewLocalizationServiceProvider' ]
Usage
Localized views are stored in files within the resources/views
directory. Within this directory there should be a subdirectory for each language supported by the application.
Views that serve as a default should go in the default resources/views
directory.
/resources
/views
/nl
messages.blade.php
messages.blade.php
In the above example the nl
locale would get a custom view, the en
locale however would get the default messages.blade.php
in the resources/views
directory.
Credits
License
The MIT License (MIT). Please see License File for more information.