Devitek / laravel-yaml-translation by CaporalDead

Add YAML file support to Laravel TranslationServiceProvider
44,585
33
5
Package Data
Maintainer Username: CaporalDead
Maintainer Contact: thomas.sieffert@devitek.fr (Thomas SIEFFERT)
Package Create Date: 2014-05-01
Package Last Update: 2017-09-28
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-04-23 03:04:39
Package Statistics
Total Downloads: 44,585
Monthly Downloads: 11
Daily Downloads: 0
Total Stars: 33
Total Watchers: 5
Total Forks: 17
Total Open Issues: 0

Add Yaml file support for Laravel 5 TranslationServiceProvider

SensioLabsInsight Latest Stable Version Total Downloads Latest Unstable Version License

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 :) !