PHP code example of bertprod / translate

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

    

bertprod / translate example snippets


use BertProd\Translate\SentenceFactory;

$iniFile = '[PATH_TO_INI_CONFIGURATION_FILE]';
$sentenceFile = '[PATH_TO_JSON_SENTENCES_FILE]';

$sentence = $sentenceFactory->createFromIni($iniFile, $sentenceFile);

$sentence->getTranslation('LABEL_HELLO_WORLD');

$sentence->setCurrentLang('nl');