Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

kevindierkx/view-localization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deprecation notice

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.