New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

devitek/yaml-translation

Add YAML file support to Laravel TranslationServiceProvider
45,633 33
Install
composer require devitek/yaml-translation
Latest Version:4.1.0
PHP:>=7.0
Laravel:5
Older releases:4
License:MIT
Last Updated:Sep 28, 2017
Links: GitHub  ·  Packagist
Maintainer: CaporalDead

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

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

665,354,487 9,703
laravel/framework

The Laravel Framework.

633,434,998 35,124
laravel/tinker

Powerful REPL for the Laravel framework.

539,265,140 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

458,029,405 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

424,642,029 4,662

Version History

Version Released PHP Laravel License
4.1.0 >=7.0 ~5.5 MIT
4.0.0 >=7.0 ~5.5 MIT
3.0.0 >=5.6.0 ~5.4.0 MIT
2.1.1 >=5.6.0 ~5.4.0 MIT
2.1.0 >=5.6.0 ~5.4.0 MIT