1. Go to this page and download the library: Download delfimov/translate 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/ */
delfimov / translate example snippets
<pre>
use DElfimov\Translate\Translate;
use DElfimov\Translate\Loader\PhpFilesLoader;
use Monolog\Logger; // PSR-3 logger, not WARNING));
$t = new Translate(
new PhpFilesLoader(__DIR__ . "/messages"),
[
"default" => "en",
"available" => ["en", "ru"],
],
$log // optional
);
$num = rand(0, 100);
$t->setLanguage("en"); // this is not keys", $num, ['tree', $num]) . "\n\n";