Custom translator for Laravel enabling translations inside translations
thomasgenster/laravel-translator is a Laravel package for custom translator for laravel enabling translations inside translations.
It currently has 0 GitHub stars and 51 downloads on Packagist.
Install it with composer require thomasgenster/laravel-translator.
Discover more Laravel packages by thomasgenster
or browse all Laravel packages to compare alternatives.
Last updated
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
Use [[ ]] as placeholders to have it be replaced by the corresponding translation key.
lang/en/default.php
array(
'hello world' => 'Please contact us at [[contact.phone]]',
)
lang/en/contact.php
array(
'phone' => '+49 12345678'
)