1. Go to this page and download the library: Download initphp/translator 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/ */
initphp / translator example snippets
use InitPHP\Translator\Translator;
$lang = new Translator();
$lang->setDir(__DIR__ . '/languages/')
->setDefault('en');
$lang->change('tr'); // switch the active language
echo $lang->translate('hello');
$lang = new Translator();
$lang->useFile() // optional; this is the default
->setDir(__DIR__ . '/languages/')
->setDefault('en');
echo $lang->translate('hello');