Popularity
2.7
Growing
Activity
2.2
Declining
87
9
34

Description

Packagist: https://packagist.org/packages/dejurin/php-google-translate-for-free

Library for free use Google Translator. With attempts connecting on failure and array support.

Programming language: PHP
License: MIT License
Tags: Strings     API     Translation     Google     Translator     Free     Translate    
Latest version: v1.0.0

Google Translate For Free alternatives and similar libraries

Based on the "Strings" category.
Alternatively, view Google Translate For Free alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of Google Translate For Free or a related project?

Add another 'Strings' Library

README

GoogleTranslateForFree

Packagist: https://packagist.org/packages/dejurin/php-google-translate-for-free

version downloads travis StyleCI

Library for free use Google Translator. With attempts connecting on failure and array support.

Installation

Install this package via Composer.

composer require dejurin/php-google-translate-for-free

Or edit your project's composer.json to require dejurin/php-google-translate-for-free and then run composer update.

"require": {
    "dejurin/php-google-translate-for-free": "^1.0"
}

Usage

require_once ('vendor/autoload.php');
use \Dejurin\GoogleTranslateForFree;

Single

$source = 'en';
$target = 'ru';
$attempts = 5;
$text = 'Hello';

$tr = new GoogleTranslateForFree();
$result = $tr->translate($source, $target, $text, $attempts);

var_dump($result); 

/* 
    string(24) "Здравствуйте" 
*/

Array

$source = 'en';
$target = 'ru';
$attempts = 5;
$arr = ['hello','world'];

$tr = new GoogleTranslateForFree();
$result = $tr->translate($source, $target, $arr, $attempts);

var_dump($result); 

/*
    array(2) {
      [0]=>
      string(24) "Здравствуйте"
      [1]=>
      string(6) "Мир"
    }

*/

License

This source code is distributed under MIT license.


Sponsors

https://currencyrate.today

https://fx-w.io/


*Note that all licence references and agreements mentioned in the Google Translate For Free README section above are relevant to that project's source code only.