bbdo / yaml-translation
Add YAML file support to Laravel TranslationServiceProvider
7.0
2022-06-30 13:30 UTC
Requires
- php: >=7.2
- illuminate/support: ^6|^7|^8|^9
- illuminate/translation: ^6|^7|^8|^9
- symfony/yaml: ^6.1
README
This package uses Symfony/Yaml parser.
Installing
Add to your composer.json by running :
composer require bbdo/yaml-translation
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
'BBDO\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 :) !