klc/translation

php translation package

Installs: 15

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/klc/translation

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

This package is auto-updated.

Last update: 2025-10-19 02:30:33 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);