blok/i18n

A i18n opiniated package for Laravel

1.3.1 2022-08-24 17:51 UTC

This package is not auto-updated.

Last update: 2024-12-12 04:03:21 UTC


README

Packagist Packagist Packagist

Package description:

Simple Laravel helper to export all the languages files in a javascript file.

Installation

Install via composer

composer require blok/i18n

Register Service Provider

Note! This and next step are optional if you use laravel>=5.5 with package auto discovery feature.

Add service provider to config/app.php in providers section

Blok\I18n\I18nServiceProvider::class,

Register Facade

Register package facade in config/app.php in aliases section

'I18n' => Blok\I18n\Facades\I18n::class,

Publish Configuration File

php artisan vendor:publish --provider="Blok\I18n\I18nServiceProvider" --tag="config"

Usage

Just call :

<script src="/js/lang.js?v={$cache versionning}"></script>

And you will have a window.i18n variable available with all the localization.

Security

If you discover any security related issues, please email instead of using the issue tracker.

Credits

This package is bootstrapped with the help of blok/laravel-package-generator.