PHP code example of klc / translation

1. Go to this page and download the library: Download klc/translation library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

klc / translation example snippets


/*
*first parameter id translation slug
*second parameter is language_id
*/

\KLC\Translation::translate('hello_world', 3);

/*
*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']);

/*
*first parameter is language_id
*/

\KLC\Translation::cacheClear(1);