Skip to content

JamesHemery/laravel-json-translation-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laravel-json-translation-loader

Travis Total Downloads MIT licensed

This package will allow you to load JSON translation files for groups and namespaces. By default Laravel only allows you to load php files for groups and namespaces translations.

Installation

You can install the package via composer:

composer require jamesh/laravel-json-translation-loader

After install package, you should replace Laravel's translation service provider in config/app.php

lluminate\Translation\TranslationServiceProvider::class,

By the service provider of this package:

Jamesh\JsonTranslationLoader\TranslationServiceProvider::class,

Usage

Register a namespace

In your service provider:

public function boot()
{
    $this->app['translator']->addNamespace('my-namespace', __DIR__ . '/my-custom-lang-directory');
}

Unit tests

To run the tests, just run composer install and composer test.

About

💬 A Laravel package to improve the loading of the JSON translation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages