lumite-studios/laravel-json-translation

There is no license information available for the latest version (v1.1) of this package.

JSON versions of the default Laravel translation files.

v1.1 2023-09-12 07:17 UTC

This package is auto-updated.

Last update: 2024-05-12 08:36:52 UTC


README

This package adds JSON translation versions of the default Laravel translation files. It also makes it possible to add custom JSON translations with a prefix.

Documentation

Installation

composer require lumite-studios/laravel-json-translation

Usage

use LumiteStudios\JSONTranslations\TranslationServiceProvider as ServiceProvider;

class TranslationServiceProvider extends ServiceProvider
{
    /**
     * Perform post-registration booting of services.
     */
    public function boot()
    {
        parent::boot();

        $this->loadJsonTranslationsWithPrefix('../../lang/errors', 'errors');
        $this->loadJsonTranslationsWithPrefix('../../lang/other', 'other');
    }
}