PHP code example of orisai / translation-contracts
1. Go to this page and download the library: Download orisai/translation-contracts 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/ */
orisai / translation-contracts example snippets
use Orisai\TranslationContracts\Translator;
assert($translator instanceof Translator);
$translator->translate('message.id', ['parameter' => 'value']); // string (translated message)
// Or
use function Orisai\TranslationContracts\t;
t('message.id', ['parameter' => 'value']); // string (translated message)