Download the PHP package begimov/localization-helper without Composer
On this page you can find all versions of the php package begimov/localization-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download begimov/localization-helper
More information about begimov/localization-helper
Files in begimov/localization-helper
Package localization-helper
Short Description Package for convenient work with Laravel's localization features
License MIT
Homepage https://github.com/awes-io/localization-helper
Informations about the package localization-helper
Localization Helper
Package for convenient work with Laravel's localization features and fast language files generation.
Installation
Via Composer
In Laravel 5.5+, service provider and facade will be automatically registered. For older versions, follow the steps below:
Register service provider in config/app.php
:
You may also register LaravelLocalization
facade:
Config
Config Files
In order to edit default configuration you may execute:
After that, config/localizationhelper.php
will be created.
Usage
Package registers global helper function _p($file_key, $default, $placeholders)
:
It will create new localization file auth.php
(if it doesn't exist) and write second parameter as language string under login
key:
On second call with same file/key _p('auth.login')
, localization string will be returned, file will remain untouched.
Placeholders are also supported:
If key is returned, it means that string already exists in localization file and you are trying to add new one using its value as an array.
Change log
Please see the changelog for more information on what has changed recently.
Testing
The coverage of the package is .
You can run the tests with:
Contributing
Please see contributing.md for details and a todolist.
Credits
- Galymzhan Begimov
- All Contributors