kevindierkx/view-localization

This package is abandoned and no longer maintained. The author suggests using the mcamara/laravel-localization package instead.
There is no license information available for the latest version (2.0.1) of this package.

Localising views in Laravel

2.0.1 2018-05-17 09:00 UTC

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.