Database driven translations for your Laravel application
- Store translations in database
- Integrates with Laravel's built-in translation system and helpers
- Install this package
Require this package with composer:
$ composer require coderscantina/translations
To add the translations table execute:
php artisan migrate
Console command to add translations:
php artisan translations:add foo1 'bar baz'
php artisan translations:add foo2 'bar baz {quz}'
We strongly advice to use a dot notation to logically group translations, like:
errors.payments.declined
Use Laravel's built-in methods for retrieving translations, such as Lang::get()
, __
and trans
helpers.
__('foo1'); // bar baz
__('foo2', ['quz' => 'qux']); // bar baz qux
Please see CHANGELOG for more information on what has changed recently.
$ composer test