Download the PHP package gabrielesbaiz/google-translate-toolkit without Composer
On this page you can find all versions of the php package gabrielesbaiz/google-translate-toolkit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gabrielesbaiz/google-translate-toolkit
More information about gabrielesbaiz/google-translate-toolkit
Files in gabrielesbaiz/google-translate-toolkit
Package google-translate-toolkit
Short Description A lightweight helper package to handle translations using Google Translate API.
License MIT
Homepage https://github.com/gabrielesbaiz/google-translate-toolkit
Informations about the package google-translate-toolkit
GoogleTranslateToolkit
A lightweight helper package to handle translations using Google Translate API.
Original code from JoggApp/laravel-google-translate
Features
- ✅ Basic translation
- ✅ Advanced translation
- ✅ Detect language
- ✅ Batch detect language
- ✅ Batch detect language
- ✅ Batch translation
- ✅ Get available translations for a given text
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
Usage
Using facade:
Available Methods
GoogleTranslateToolkit::detectLanguage(string $text): array
- Detect the language.GoogleTranslateToolkit::detectLanguage(array $texts): array
- Detect the language.GoogleTranslateToolkit::translate(string $text): array
- Translate the given text.GoogleTranslateToolkit::translate(array $texts): array
- Translate the given text.GoogleTranslateToolkit::justTranslate(string $text)): string
- Translate the given text.GoogleTranslateToolkit::getAvailableTranslationsFor('en'): array
- Get all the available translations from 'Google Translation' for a particular language by passing its language code.GoogleTranslateToolkit::unlessLanguageIs('en', string $text): array
- Translate unless the language is same as the first argument. It accepts an optional third argument which is the language code you want the string to be translated in. You can specify the default option in the config file. If the languages are same, the input string is returned as it is, else an array is returned containing the translation results.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Jogg
- Gabriele Sbaiz
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of google-translate-toolkit with dependencies
google/cloud-translate Version ^1.2
illuminate/contracts Version ^10.0||^11.0||^12.0
spatie/laravel-package-tools Version ^1.16