morimorim / laravel-flexisble-translator
Laravel Flexible Translator
0.0.1
2023-12-02 05:14 UTC
Requires
- php: ^8.2
- eftec/bladeone: ^4.9
- illuminate/support: ^9|^10
- ray/aop: ^2
Requires (Dev)
- phpunit/phpunit: ^10.4
README
This is package of translations for Laravel
See also example.
Install
composer require morimorim/laravel-flexisble-translator
Usage
1.Run migrate to create translations
table
php artisan migrate
2.Insert translations
Translation::create([
'key' => self::KEY_DB,
'texts' => [
'ja' => '(DB) :num δΎ‹',
'en' => '(DB) example :num',
],
]);
3.Use trans
like same as default.
trans('messages.example');
__('messages.example');
Lang::choice('messages.example.choice', 10);