PHP code example of ippey / weglot-integration

1. Go to this page and download the library: Download ippey/weglot-integration 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/ */

    

ippey / weglot-integration example snippets


$text = 'Spirited Away';
$from = 'en';
$to = 'ja';
$translated = \ippey\weglotintegration\Weglotintegration::getInstance()->weglotService->translate($text, $from, $to);
echo ($translated); // 千と千尋の神隠し

{{ '攻殻機動隊' | weglot_translate('ja', 'en') }}
Ghost in the Shell.