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.
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,
In your service provider:
public function boot()
{
$this->app['translator']->addNamespace('my-namespace', __DIR__ . '/my-custom-lang-directory');
}
To run the tests, just run composer install
and composer test
.