PHP code example of hsnfirdaus / subtitle-google-translator
1. Go to this page and download the library: Download hsnfirdaus/subtitle-google-translator 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/ */
hsnfirdaus / subtitle-google-translator example snippets
$translator = new Hsnfirdaus\SubtitleTranslator($source_lang,$target_lang);
$translator = new Hsnfirdaus\SubtitleTranslator($source_lang,$target_lang);
$translated = $translator->fromRaw($raw_subtitle);
echo $translated;
$translator = new Hsnfirdaus\SubtitleTranslator($source_lang,$target_lang);
$translated = $translator->fromFile($file_path);
echo $translated;