Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

Astrotomic/laravel-translation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.