Download the PHP package shishima/laravel-translate-spreadsheet without Composer
On this page you can find all versions of the php package shishima/laravel-translate-spreadsheet. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shishima/laravel-translate-spreadsheet
More information about shishima/laravel-translate-spreadsheet
Files in shishima/laravel-translate-spreadsheet
Package laravel-translate-spreadsheet
Short Description This package is used to translate spreadsheet files
License MIT
Homepage https://github.com/shishima/laravel-translate-spreadsheet
Informations about the package laravel-translate-spreadsheet
Translate Spreadsheet
This package serves the purpose of translating the contents within the spreadsheet file. It facilitates the transition from the original language to your preferred language
Installation
You can install the package via composer:
Publish config
php artisan vendor:publish --provider="Shishima\TranslateSpreadsheet\TranslateSpreadsheetServiceProvider"
After publishing the configuration file, you can edit the app/config/translate-spreadsheet.php file to customize the settings.
Usage
translate
The file can be a path to a file on the system
Or it could be a file retrieved from the request
when using the POST
method in a form submit
with <input type="file">
.
setTransTarget
To set the desired translation language target
setTransSource
To set the desired translation language source
IMPORTANT! Pass in null
if you want to use language detection
setShouldRemoveSheet
Clear the current sheets after translation is complete. The parameter passed to the method is true/false
.
setOutputDir
Directory to store files after translation
IMPORTANT! The file will be stored in the public
directory, not in the storage
directory.
setCloneSheetPosition
Position of the cloned sheets
The parameter passed in is enum ClonePosition
. You can refer to it in the file Enumerations/ClonePosition.php for more detail.
highlightSheet
Sheets will be highlighted after export
translateSheetName
Sheets Name will be translated after export
enableDebug
For logging translated sentences into a log file for debugging purposes
To disable this feature, pass false
as the argument.
Translate Engine
The package supports two translation engines: Google Translate and Gemini
It can be installed through the translate_engine
setting in the config file
Alternatively, you can use the setTranslateEngine function.
The parameter to be passed is an Enum TranslateEngine, which can be either TranslateEngine::Gemini
or TranslateEngine::Google
Google Translate
No need for setting
Gemini
This functionality has been developed from google-gemini-php/laravel library
Therefore, please install this package before use
Testing
Demo
Utilize the repository below as a reference for how to use it.
https://github.com/shishima123/laravel-translate-spreadsheet-demo
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Phuoc Nguyen
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.
Special Thanks
All versions of laravel-translate-spreadsheet with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
phpoffice/phpspreadsheet Version ^1.29
stichoza/google-translate-php Version ^5.1