New

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

thomasgenster/laravel-translator

Custom translator for Laravel enabling translations inside translations
51
Install
composer require thomasgenster/laravel-translator:dev-master
PHP:>=5.3.0
Last Updated:Dec 1, 2016
Links: GitHub  ·  Packagist
Maintainer: thomasgenster

laravel-translator

Custom translator for Laravel that prevents the need to use traditional placeholders for getting a translation inside a translation

Add the following to you Providers array (app/config/app.php):

Genster\CustomLaravelTranslator\TranslatorProvider

Remove/uncomment the default provider:

Illuminate\Translation\TranslationServiceProvider

Usage:

Use [[ ]] as placeholders to have it be replaced by the corresponding translation key.

Example:

lang/en/default.php

array(
    'hello world' => 'Please contact us at [[contact.phone]]',
)

lang/en/contact.php

array(
    'phone' => '+49 12345678'
)

Related Packages

doctrine/dbal

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

655,942,320 9,702
laravel/framework

The Laravel Framework.

617,629,957 34,997
laravel/tinker

Powerful REPL for the Laravel framework.

524,145,802 7,444
laravel/serializable-closure

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

442,489,569 607
nunomaduro/collision

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

418,503,470 4,663