PHP code example of ali-translator / translation-js-integrate

1. Go to this page and download the library: Download ali-translator/translation-js-integrate 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/ */

    

ali-translator / translation-js-integrate example snippets


use ALI\TranslatorJsIntegrate\ALIAbcTranslatorJs;
use ALI\Translator\PlainTranslator\PlainTranslator;

/** @var PlainTranslator $plainTranslator */

$ALIAbcTranslatorJs = new ALIAbcTranslatorJs($plainTranslator);

use \ALI\TranslatorJsIntegrate\ALIAbcTranslatorJs;

/** @var ALIAbcTranslatorJs $aLIAbsTranslatorJs */

// $aliAbc->saveTranslate('Hello {object}!', 'Привіт {object}!');

$aLIAbsTranslatorJs->addOriginals(['Hello {object}!']);
$startUpJsCode = $aLIAbsTranslatorJs->generateStartupJs('__t');
bash
docker-compose run php composer install
docker-compose run php vendor/bin/phpunit