Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jameshemery/laravel-json-translation-loader
:speech_balloon: A Laravel package to improve the loading of the JSON translation.
https://github.com/jameshemery/laravel-json-translation-loader
i18n json laravel laravel-package php
Last synced: about 22 hours ago
JSON representation
:speech_balloon: A Laravel package to improve the loading of the JSON translation.
- Host: GitHub
- URL: https://github.com/jameshemery/laravel-json-translation-loader
- Owner: JamesHemery
- License: mit
- Created: 2019-05-02T20:42:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-21T11:27:08.000Z (almost 5 years ago)
- Last Synced: 2024-10-11T20:42:59.271Z (about 1 month ago)
- Topics: i18n, json, laravel, laravel-package, php
- Language: PHP
- Homepage:
- Size: 12.7 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# laravel-json-translation-loader
[![Travis](https://img.shields.io/travis/JamesHemery/laravel-json-translation-loader.svg?style=for-the-badge)](https://travis-ci.org/JamesHemery/laravel-json-translation-loader)
[![Total Downloads](https://img.shields.io/packagist/dt/jamesh/laravel-json-translation-loader.svg?style=for-the-badge)](https://packagist.org/packages/jamesh/laravel-json-translation-loader)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge)](https://raw.githubusercontent.com/JamesHemery/laravel-json-translation-loader/master/LICENSE)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`
```php
lluminate\Translation\TranslationServiceProvider::class,
```By the service provider of this package:
```php
Jamesh\JsonTranslationLoader\TranslationServiceProvider::class,
```## Usage
#### Register a namespace
In your service provider:
```php
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`.