1. Go to this page and download the library: Download nabeghe/light-localization 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/ */
nabeghe / light-localization example snippets
use Nabeghe\LightLocalization\Localizer;
$en = new Localizer(__DIR__ . '/langs', 'en');
$fa = new Localizer(__DIR__ . '/langs', 'fa', $en); // $en is the fallback
// Reads from main.php (default group)
echo $fa->get('title');
// Reads from messages.php
echo $fa->get('success', 'messages');
// Returns a random item when the value is an array
echo $fa->rnd('greet');