devitek / yaml-translation
Add YAML file support to Laravel TranslationServiceProvider
Installs: 44 681
Dependents: 2
Suggesters: 0
Security: 0
Stars: 33
Watchers: 4
Forks: 17
Open Issues: 0
Requires
- php: >=7.0
- illuminate/support: ~5.5
- illuminate/translation: ~5.5
- symfony/yaml: 3.*
README
This package uses Symfony/Yaml parser.
Installing
Add "devitek/yaml-translation": "4.*"
to your composer.json by running :
composer require devitek/yaml-translation
And select version: 4.*
Finally, publish all vendor assets to create a yaml-translation.php
:
php artisan vendor:publish
Add support in Laravel
You have to replace
'Illuminate\Translation\TranslationServiceProvider',
with
'Devitek\Core\Translation\TranslationServiceProvider',
in app/config/app.php.
How to use
Just use regular php files or use yml or yaml files instead.
PHP :
<?php return [ 'hello' => 'Hello :name', 'author' => 'Devitek', ];
Will be equivalent to :
YAML
hello: Hello :name author: Devitek
Enjoy it ! Feel free to fork :) !