Download the PHP package zeliard91/google-translator-bundle without Composer

On this page you can find all versions of the php package zeliard91/google-translator-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package google-translator-bundle

PryonGoogleTranslatorBundle

SensioLabsInsight Build Status

This bundle provides a symfony service to interact with Google Translate API. https://developers.google.com/translate/v2/getting_started

To be able to translate sentences, you have to enable billing on your Google Cloud Console https://developers.google.com/translate/v2/pricing

Installation

Installation is a quick 3 step process:

  1. Download PryonGoogleTranslatorBundle using composer
  2. Enable the Bundle
  3. Configure your application's config.yml

Step 1: Download PryonGoogleTranslatorBundle using composer

Step 2: Enable the bundle

Enable the bundle in the kernel:

Step 3: Add your Google API Key in configuration

Usage

The bundle provides a service to your app in order to call the Google Translate API in REST.

Exemples

Get supported languages

Translate sentences

Be aware that Google restricts the use of this service by limiting the size of the query at 5K caracteres with the POST method (and 2K in GET). The number of queries is also limited to 128 if you pass an array for the third argument of the translate method.

The translate method detects if these limits are reached and call the API as many times as necessary which may result a long processing.

Form Type

A "translatorlanguage" Form Type is also present in this bundle. It is basically the same as the core "language" Form Type except from the choices list which is filled by the API.

Cache

You can cache the responses of the API with one of the subclasses of Doctrine\Common\Cache\CacheProvider

This can be done by specifying what you want to cache and with what in the configuration file. This is the default configuration :

HTTP Client Options

You can define default HTTP headesr for the REST client hitting the Google API :

See Guzzle doc for more information.


All versions of google-translator-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.5
doctrine/cache Version ^1.0
guzzlehttp/guzzle Version ^6.2
symfony/form Version ^4.4|^5.2
symfony/config Version ^4.4|^5.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zeliard91/google-translator-bundle contains the following files

Loading the files please wait ....