klc/translation

php translation package

v1.1.0 2021-09-18 16:28 UTC

This package is auto-updated.

Last update: 2024-04-18 22:49:42 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);