blok / i18n
A i18n opiniated package for Laravel
Requires
- php: >=7.0
- illuminate/support: >=5.5
Requires (Dev)
- orchestra/testbench: >=3.6
- phpunit/phpunit: >=7.0
This package is not auto-updated.
Last update: 2024-11-14 03:38:20 UTC
README
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.