Looking to hire Laravel developers? Try LaraJobs

laravel-translation maintained by astrotomic

Description
A Laravel 5 package that implements the Symfony Po-Translation lib.
Author
Last update
2016/09/29 15:31 (dev-master)
License
Links
Downloads
9

Comments
comments powered by Disqus

Laravel Translation

GitHub Author GitHub release GitHub license GitHub issues

Travis branch StyleCI Code Climate Code Climate Code Climate

This is a laravel wrapper for the Symfony PoTranslator. It comes with two global helper functions __() and _n().

Installation

composer.json "astrotomic/laravel-translation": "dev-master"

config/app.php

return [
    ...
    'providers' => [
        Astrotomic\Laravel\Translation\TranslatorServiceProvider::class,
    ],
    ...
    'aliases' => [
        'Trans' => Astrotomic\Laravel\Translation\Facades\TranslatorFacade::class,
    ],
    ...
];

console

composer update
artisan vendor:publish

Usage

To generate the po files you first have to compile all your views, PoEdit can't handle blade, to do this use the artisan command artisan view:compile. After this you can generate the po files and the proper header with artisan trans:po. To collect and translate all the strings use PoEdit.