1. Go to this page and download the library: Download sroehrl/php-i18n-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/ */
$t = new I18nTranslate();
$all = [
['eo' => ['blue' => 'blua',...]],
['jp' => ['blue' => '青い',...]], // BTW: make sure to consider encoding
['de' => ['blue' => 'blau',...]],
];
foreach($all as $lang => $translations){
$t->setTranslations($lang, $translations);
}
$locale = 'en-US';
$clientTimeZone = 'America/New_York'; // or null to let the class make an educated guess
$formatter = new I18nTranslate\Formatter(string $locale, $clientTimeZone);
$convertToClientTime = $formatter->format('time-local');
$serverTime = time();
$clientTime = $convertToClientTime($serverTime); // e.g. 09:30 AM EDT
$clientTime = $convertToClientTime($serverTime, 'h:mm'); // e.g. 9:30