thomasgenster/laravel-translator

There is no license information available for the latest version (dev-master) of this package.

Custom translator for Laravel enabling translations inside translations

Installs: 51

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/thomasgenster/laravel-translator

dev-master 2016-12-01 15:05 UTC

This package is not auto-updated.

Last update: 2025-10-06 18:23:56 UTC


README

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'
)