klc / translation
php translation package
v1.1.0
2021-09-18 16:28 UTC
Requires
- php: >=7.4
- ext-redis: *
- illuminate/console: ^8.0
- illuminate/database: ^8.0
- illuminate/filesystem: ^8.0
- illuminate/redis: ^8.0
- illuminate/support: ^8.0
- klc/data-chain: ^1.0
Requires (Dev)
- doctrine/dbal: 3.1.x-dev
- orchestra/testbench: 6.x-dev
- phpunit/phpunit: 9.5.x-dev
This package is auto-updated.
Last update: 2025-04-19 01:27:05 UTC
README
composer require klc/translation
php artisan migrate
How To Use
Get translation :
/* *first parameter id translation slug *second parameter is language_id */ \KLC\Translation::translate('hello_world', 3);
Get translation with dynamic parameter :
/* *Translation is "Hello %s" *first parameter id translation slug *second parameter is language_id *third parameter is translation parameter */ \KLC\Translation::translate('hello', 2, ['World']); \KLC\Translation::translate('hello', 2, ['John']);
Clear translation cache :
/* *first parameter is language_id */ \KLC\Translation::cacheClear(1);