PHP code example of shishima / laravel-translate-spreadsheet
1. Go to this page and download the library: Download shishima/laravel-translate-spreadsheet 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/ */
shishima / laravel-translate-spreadsheet example snippets
use Shishima\TranslateSpreadsheet\Facades\TranslateSpreadsheet;
$fileInput = public_path('demo.xlsx');
TranslateSpreadsheet::translate($fileInput);
TranslateSpreadsheet::translate($request->file('file'));
TranslateSpreadsheet::setTransTarget('en')->translate($file);
TranslateSpreadsheet::setTransSource('en')->translate($file);
TranslateSpreadsheet::setShouldRemoveSheet(true)->translate($file);
TranslateSpreadsheet::setOutputDir('translate/')->translate($file);
use Shishima\TranslateSpreadsheet\Enumerations\ClonePosition;
TranslateSpreadsheet::setCloneSheetPosition(ClonePosition::AppendLastSheet)->translate($file);
TranslateSpreadsheet::highlightSheet(true)->translate($file);
TranslateSpreadsheet::translateSheetName(true)->translate($file);
TranslateSpreadsheet::enableDebug()->translate($file);
use Shishima\TranslateSpreadsheet\Enumerations\TranslateEngine;
TranslateSpreadsheet::setTranslateEngine(TranslateEngine::Gemini)->translate($file);