1. Go to this page and download the library: Download yiisoft/i18n-message-php 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/ */
yiisoft / i18n-message-php example snippets
use Yiisoft\Translator\CategorySource;
use Yiisoft\Translator\IntlMessageFormatter;
use Yiisoft\Translator\Message\Php\MessageSource;
$categorySource = new CategorySource(
'my-category',
new MessageSource('/path/to/messages'),
new IntlMessageFormatter(),
);
/** @var string $path - full path to your translations */
$messageSource = new \Yiisoft\Translator\Message\Php\MessageSource($path);